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

update the graph

parent 815d6e3c
Branches
No related tags found
No related merge requests found
...@@ -55,12 +55,15 @@ def bench_knn(): ...@@ -55,12 +55,15 @@ def bench_knn():
accuracies.append(accuracy) accuracies.append(accuracy)
# Save and show the graph of accuracies # 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.plot(k_indices, accuracies)
plt.title("Accuracy as function of k") plt.title("Accuracy as function of k")
plt.legend()
plt.grid(True)
plt.show() plt.show()
plt.savefig('image-classification/results/knn_batch_1.png') plt.savefig('image-classification/results/knn_batch_1.png')
plt.close(fig)
if __name__ == "__main__": if __name__ == "__main__":
...@@ -76,8 +79,3 @@ if __name__ == "__main__": ...@@ -76,8 +79,3 @@ if __name__ == "__main__":
# x_train = np.array([[2,4],[7,2],[4,6]]) # x_train = np.array([[2,4],[7,2],[4,6]])
# y_train = [1,2,1] # y_train = [1,2,1]
# dist = distance_matrix(x_test,x_train) # dist = distance_matrix(x_test,x_train)
\ No newline at end of file
\ 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