From the course: Data Science Foundations: Data Mining in R

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Naive Bayes

Naive Bayes

From the course: Data Science Foundations: Data Mining in R

Start my 1-month free trial

Naive Bayes

- [Instructor] It's strange to talk about something being naive when we're trying to do serious data science but Naive Bayes , which again means that is treating each of the variables as independent, is an important and useful method for classification exercises in data science and here in data mining. To do this, I'm going to start by learning a few packages, including this one, Naive Bayes , along with some of our other testing functions. I'll set the random seed, and I'm going to import the training and testing datasets that we got from the spam basic data set, so trn for train and tst for test. I'm then going to set up some control parameters. I'm going to be using the same information I used in the k-nearest neighbors model. It says we want to do repeated cross-validation with five folds and three sets of folds. This gives us a very comprehensive way of doing internal testing with our training data before we moved on…

Contents