Problem 1
Build an R Notebook of the SMS message ltering example in the textbook on pages 103 to 123 (data set).
Show each step and add appropriate documentation. Note that the attached data set diers slightly from the
one used on the book; the number of cases dier.
Problem 2
Install the requisite packages to execute the following code that classies the built-in data using Naive
Bayes. Build an R Notebook and explain in detail what each step does. Be sure to look up each function to
understand how it is used.
As always, complete the practice problems on time and review them with your peers. If you would like more
detailed feedback come to oce hours.
iris
library(klaR)
data(iris)
nrow(iris)
summary(iris)
head(iris)
testidx <- which(1:length(iris[, 1]) %% 5 == 0)
# separate into training and testing datasets
iristrain <- iris[-testidx,]
iristest <- iris[testidx,]
# apply Naive Bayes
nbmodel <- NaiveBayes(Species~., data=iristrain)
6/15/2020 Practice 4 – DA5030 | Machine Learning & Data Mining
https://da5030.weebly.com/practice-4.html 2/3
Notes
Producing a word cloud directly from raw text: might produce the error “invalid input ‘Γ’Β£1000’ in
‘utf8towcs'”. There is a solution at stackoverow. Basically you need to remove non-graphical
characters from the raw text using regular expressions (explained in the link).
The function from the tm package is deprecated and no longer available. Instead, store the
result of directly as a character vector with:
.
( )
[SOLVED] DA5030 Problems 4
30.00 $
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
Securely Powered by:
- Practice-4-hu68qo.zip



