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

Unlock the full course today

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

Challenge: KNN

Challenge: KNN - Python Tutorial

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

Start my 1-month free trial

Challenge: KNN

(bright music) - [Instructor] Keeping spam emails out of your inbox is helpful and I'm grateful for it, but when it comes to data mining and machine learning, some tasks are life and death, and in this challenge, I want to invite you to apply one of these approaches, the k-NN, k-Nearest Neighbors algorithm, to a dataset about breast cancer. To do this, I'd like you to import and prepare the breast cancer training and testing dataset, prepare the data, train and optimize the model, plot of the accuracy of the parameters, apply the k-NN model to the training data, graph the confusion matrix, and get the overall accuracy of the model on the testing data. This is following the example we had in the k-NN presentation. Now I want to show you a little bit about the dataset. So I'm going start by importing some libraries. Then I'm going to import the data. This is another dataset from the University of California Irvine…

Contents