plt.plot(neighbors, train_scores, label="Train Score")
plt.plot(neighbors, test_scores, label="Test Score")
plt.xticks(np.arange(1,21,1))
plt.xlabel("Number of Neighbors")
plt.ylabel("Score")
plt.legend()
plt.show()
`print(f"Maximum KNN score on the test data is: {max(test_scores)*100:.2f}%")`
it gives me a Type error
TypeError Traceback (most recent call last)
Cell In[62], line 5
3 plt.plot(neighbors, train_scores, label="Train Score")
4 plt.plot(neighbors, test_scores, label="Test Score")
----> 5 plt.xticks(np.arange(1,21,1))
6 plt.xlabel("Number of Neighbors")
7 plt.ylabel("Score")
TypeError: ‘int’ object is not callable
I tried looking if mistakly i have use x_ticks as s varialble but it is not the case
New contributor
Atharv Patil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.