index = np.arange(1, 15, 1) plt.plot(index, acc_score_list, c='blue', linestyle='solid') plt.plot(index, f1_score_list, c='red', linestyle='dashed') plt.legend(["Accuracy", "F1 Score"]) plt.xlabel("k value") plt.ylabel("Score") plt.grid('false') plt.show() KNN_acc = max(f1_score_list)*100 print("Maximum KNN Score is {:.2f}%".format(KNN_acc))