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.

Solution: K-nn

Solution: K-nn

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

Start my 1-month free trial

Solution: K-nn

(upbeat music) - [Narrator] I invited you to do a k-nearest neighbors classification analysis on a breast cancer data set. Let me show you how I did this and we can compare our approaches and the results you may have gotten. I'm going to start by repeating the things I did in the challenge by loading the packages, setting the seed loading the data set from the ML bench package and then preparing the data by selecting variables transforming some to numeric and so on. Splitting into training and testing data sets and then exploring to get a bar chart of benign versus malignant. And then the Parris plot that lets me know that it looks like we're going to have good separation on the variables. I invited you to do a K nearest neighbors analysis on this one. And so I'm actually going to be using many of the same approaches that we had in our earlier example of kNN. I wanted to set up the stack control by doing repeated…

Contents