This report explains my exploratory analysis and your goals for the eventual app and algorithm.
The motivation for this project is to: 1. Demonstrate that you’ve downloaded the data and have successfully loaded it in.2. Create a basic report of summary statistics about the data sets.3. Report any interesting findings that you amassed so far.4. Get feedback on your plans for creating a prediction algorithm and Shiny app.
US-English training data files only (3 files) - en_US.blogs.txt - en_US.news.txt - en_US.twitter.txt
## Loading required package: NLP
## Loading required package: readtext
## Warning: package 'readtext' was built under R version 4.2.3
## Loading required package: quanteda
## Warning: package 'quanteda' was built under R version 4.2.3
## Warning in .recacheSubclasses(def@className, def, env): undefined subclass
## "ndiMatrix" of class "replValueSp"; definition not updated
## Package version: 4.0.1
## Unicode version: 13.0
## ICU version: 69.1
## Parallel computing: 20 of 20 threads used.
## See https://quanteda.io for tutorials and examples.
##
## Attaching package: 'quanteda'
## The following object is masked from 'package:readtext':
##
## texts
## The following object is masked from 'package:tm':
##
## stopwords
## The following objects are masked from 'package:NLP':
##
## meta, meta<-
## Loading required package: quanteda.textstats
## Warning: package 'quanteda.textstats' was built under R version 4.2.3
## Warning: undefined subclass "ndiMatrix" of class "replValueSp"; definition not
## updated
## Loading required package: quanteda.textplots
## Warning: package 'quanteda.textplots' was built under R version 4.2.3
## Loading required package: quanteda.corpora
## Warning in library(package, lib.loc = lib.loc, character.only = TRUE,
## logical.return = TRUE, : there is no package called 'quanteda.corpora'
## Installing package into 'C:/Users/RussS/AppData/Local/R/win-library/4.2'
## (as 'lib' is unspecified)
## Warning: package 'quanteda.corpora' is not available for this version of R
##
## A version of this package for your version of R might be available elsewhere,
## see the ideas at
## https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
## Warning: package 'ggplot2' was built under R version 4.2.3
##
## Attaching package: 'ggplot2'
## The following object is masked from 'package:NLP':
##
## annotate
## Number of lines in en_US.blogs.txt : 184000
## Number of lines in en_US.twitter.txt : 471800
## Number of lines in en_US.news.txt : 206000
Files have been sampled 20%
## [1] "Number of words instances per file"
## en_US.blogs.txt en_US.news.txt en_US.twitter.txt
## 7593393 2635572 5993176
## [1] "Total number of words in the corpus"
## [1] 16222141
## Document-feature matrix of: 3 documents, 306,153 features (53.38% sparse) and 0 docvars.
## features
## docs in the years thereafter most of oil fields
## en_US.blogs.txt 15 120852 377995 6749 48 8068 178311 1168 244
## en_US.news.txt 0 51452 151489 3655 14 2726 59040 488 89
## en_US.twitter.txt 0 75519 187941 2614 8 3743 71687 278 78
## features
## docs and
## en_US.blogs.txt 222284
## en_US.news.txt 68255
## en_US.twitter.txt 87851
## [ reached max_nfeat ... 306,143 more features ]
## Top 50 most frequent words - EN-US Docs (Sampled):
## feature frequency rank docfreq group
## 1 the 717425 1 3 all
## 2 to 443697 2 3 all
## 3 and 378390 3 3 all
## 4 a 371975 4 3 all
## 5 i 315102 5 3 all
## 6 of 309038 6 3 all
## 7 in 247823 7 3 all
## 8 is 182513 8 3 all
## 9 for 178054 9 3 all
## 10 you 177409 10 3 all
## 11 that 167005 11 3 all
## 12 it 158305 12 3 all
## 13 on 132100 13 3 all
## 14 my 116266 14 3 all
## 15 with 112699 15 3 all
## 16 was 98158 16 3 all
## 17 this 95046 17 3 all
## 18 be 91582 18 3 all
## 19 have 89276 19 3 all
## 20 at 88697 20 3 all
## 21 are 81690 21 3 all
## 22 but 79054 22 3 all
## 23 as 74141 23 3 all
## 24 we 72305 24 3 all
## 25 me 71289 25 3 all
## 26 so 70645 26 3 all
## 27 not 68804 27 3 all
## 28 he 58795 28 3 all
## 29 all 58755 29 3 all
## 30 from 58288 30 3 all
## 31 your 56858 31 3 all
## 32 just 54587 32 3 all
## 33 they 50811 33 3 all
## 34 out 50772 34 3 all
## 35 or 50730 35 3 all
## 36 up 50017 36 3 all
## 37 will 49984 37 3 all
## 38 what 49365 38 3 all
## 39 about 49051 39 3 all
## 40 if 48354 40 3 all
## 41 like 48293 41 3 all
## 42 one 48270 42 3 all
## 43 by 47112 43 3 all
## 44 an 44847 44 3 all
## 45 when 43600 45 3 all
## 46 do 43486 46 3 all
## 47 can 42727 47 3 all
## 48 his 41150 48 3 all
## 49 get 40131 49 3 all
## 50 more 38216 50 3 all
## Top 20 2-gram - EN-US Docs (Sampled):
## Top 20 3-gram - EN-US Docs (Sampled):
## Warning in wordcloud(x, min_size, max_size, min_count, max_words, color, :
## what_do_you could not be fit on page. It will not be plotted.
## Warning in wordcloud(x, min_size, max_size, min_count, max_words, color, :
## do_you_think could not be fit on page. It will not be plotted.
## Warning in wordcloud(x, min_size, max_size, min_count, max_words, color, :
## the_united_states could not be fit on page. It will not be plotted.
## Warning in wordcloud(x, min_size, max_size, min_count, max_words, color, :
## the_same_time could not be fit on page. It will not be plotted.
## Warning in wordcloud(x, min_size, max_size, min_count, max_words, color, :
## in_the_morning could not be fit on page. It will not be plotted.
## Unique words do you need in a frequency sorted dictionary to cover 50 % of all word instances in the language: 141
## Unique words do you need in a frequency sorted dictionary to cover 90 % of all word instances in the language: 7973
Full set (not sampled)
- unique words do you need in a frequency sorted dictionary to cover 50
% of all word instances in the language: 132
- unique words do you need in a frequency sorted dictionary to cover 90
% of all word instances in the language: 7409
Sample set
- Unique words do you need in a frequency sorted dictionary to cover 50
% of all word instances in the language: 141
- Unique words do you need in a frequency sorted dictionary to cover 90
% of all word instances in the language: 7973