Instantly share code, notes, and snippets.

Embed
What would you like to do?
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import confusion_matrix
clf = KNeighborsClassifier(n_neighbors=13)
clf.fit(X_train, y_train)
print "done"
print "="*20
print clf
print "Confusion Matrix"
print "="*40
print confusion_matrix(y_test, clf.predict(X_test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment