Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2.  
  3. plt.figure()
  4. acc = []
  5. for k in [1, 3, 5, 7, 9]:
  6. clr = Knn_classifier(train_images, train_labels)
  7. predicted_labels = clr.classify_images(test_images, k)
  8. acc.append(clr.accuracy_score(test_labels, predicted_labels))
  9. print(acc)
  10.  
  11. plt.plot([1, 3, 5, 7, 9], acc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement