text_plain_output_1.png
from sklearn.metrics import confusion_matrix

from sklearn.neighbors import KNeighborsClassifier

knn = KNeighborsClassifier(n_neighbors=5)
knn.fit(X_train, y_train)

y_pred = knn.predict(X_valid)

confusion_matrix(y_valid, y_pred)