Skip to content

Instantly share code, notes, and snippets.

@purva91
Created September 9, 2019 12:56
Show Gist options
  • Save purva91/23f389a3234d31d58eaa7de3975fc0c0 to your computer and use it in GitHub Desktop.
Save purva91/23f389a3234d31d58eaa7de3975fc0c0 to your computer and use it in GitHub Desktop.
plt.figure(figsize=(10,5))
plt.xlabel('Different Values of K')
plt.ylabel('Model score')
plt.plot(k_vals, train_score, color = 'r', label = "training score")
plt.plot(k_vals, test_score, color = 'b', label = 'test score')
plt.legend(bbox_to_anchor=(1, 1),
bbox_transform=plt.gcf().transFigure)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment