Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@purva91
Created September 11, 2019 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purva91/278692f2706b092060667de348808219 to your computer and use it in GitHub Desktop.
Save purva91/278692f2706b092060667de348808219 to your computer and use it in GitHub Desktop.
precision, recall, thresholds = precision_recall_curve(y_test, y_pred_proba)
plt.figure(figsize=(10,8))
plt.plot([0, 1], [0.5, 0.5],'k--')
plt.plot(recall, precision, label='Knn')
plt.xlabel('recall')
plt.ylabel('precision')
plt.title('Knn(n_neighbors=5) PRC curve')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment