Load Data # load iris data from sklearn.datasets import load_iris iris = load_iris() # store feature matrix in "X" X = iris.data # store response vector in "X" y = iris.target print(X.shape) print(y.shape) (150, 4) (150,) KNN from sklearn.neighbors import KNeighborsClassifier knn = KNeighborsClass