Question: We will be using th e1071 R implementation of the Nave Bayes classification for the beloved Iris data set. 1. Install the CRAN E1071 package:
We will be using th e1071 R implementation of the Nave Bayes classification for the beloved Iris data set. 1. Install the CRAN E1071 package: TRUE - install.packagese1071, dependencies Load the package as a library hibrary(class) ibrary(e1071) Visualize the data to show each attribute plotted with the other > pairsris/1:41 main -"Iris Data (red setosa,green-versicolor,bkue virginica)", 2 3. pch-21, bg = c("red",-greens, tlue")(unclass(iris$Species)D Specify which base we are going to be using > data(iris) > summary(iris) 4. 5. Now we can create the Naive Bayes model to the dataset using the first 4 columns to predict the fifth. Factor the target column so: > classifier table(predict(classifier, irisl-5), irisl,5) Questions (2.B) Does Nave bayes make a lot of mistakes while classifying? What is the accuracy from the confusion matrix? 1. (If interested in how to build a spam filter using R and Naive Bayes, refer to: https://rpubs.com/mzc/mlwr nb sms spam)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
