Skip to content
Snippets Groups Projects
Commit a3d152ab authored by corentin's avatar corentin
Browse files

update the graph

parent 815d6e3c
No related merge requests found
......@@ -55,12 +55,15 @@ def bench_knn():
accuracies.append(accuracy)
# Save and show the graph of accuracies
fig = plt.figure()
plt.figure(figsize=(8, 6))
plt.xlabel('K')
plt.ylabel('Accuracy')
plt.plot(k_indices, accuracies)
plt.title("Accuracy as function of k")
plt.legend()
plt.grid(True)
plt.show()
plt.savefig('image-classification/results/knn_batch_1.png')
plt.close(fig)
if __name__ == "__main__":
......@@ -75,9 +78,4 @@ if __name__ == "__main__":
# x_test = np.array([[1,2],[4,6]])
# x_train = np.array([[2,4],[7,2],[4,6]])
# y_train = [1,2,1]
# dist = distance_matrix(x_test,x_train)
\ No newline at end of file
# dist = distance_matrix(x_test,x_train)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment