Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- plt.figure()
- acc = []
- for k in [1, 3, 5, 7, 9]:
- clr = Knn_classifier(train_images, train_labels)
- predicted_labels = clr.classify_images(test_images, k)
- acc.append(clr.accuracy_score(test_labels, predicted_labels))
- print(acc)
- plt.plot([1, 3, 5, 7, 9], acc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement