k-NN Implementation Steps: 1 to 5
This lesson will familiarize you with the implementation steps (1-5) of the k-nearest neighbor method.
We'll cover the following...
1) Import libraries
This model is built using the KNeighborsClassifier
from Scikit-learn
. You’ll also be relying on StandardScaler
to standardize the data, as you did earlier with principal component analysis.
Press + to interact
main.py
advertising.csv
#1- Import librariesimport pandas as pdfrom sklearn.preprocessing import StandardScalerfrom sklearn.model_selection import train_test_splitfrom sklearn.neighbors import KNeighborsClassifierfrom sklearn.metrics import classification_report, confusion_matrix
Note ...