2.1.13.2.KNN with Python
1. 匯入基本的library
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns%matplotlib inline
2.讀取資料並了解資料
df = pd.read_csv('Classified Data', index_col = 0)
df.head()
3.標準化資料
4.使用Skikit-learn library
5.使用KNN classifier進行預測
6.評估模型的精度
7.調整K值
Last updated


