Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. from sklearn.metrics import roc_curve, auc,recall_score,precision_score
  3.  
  4. fpr, tpr, _ = roc_curve(y_test, pred)
  5. roc_auc = auc(fpr, tpr)
  6. plt.figure()
  7. lw = 2
  8. plt.plot(fpr, tpr, color='orange',
  9. lw=lw, label='AUC = %0.4f' % roc_auc)
  10. plt.plot([0, 1], [0, 1], color='steelblue', lw=lw, linestyle='--')
  11. plt.xlim([-0.02, 1.0])
  12. plt.ylim([0.0, 1.05])
  13. plt.xlabel('False Positive Rate')
  14. plt.ylabel('True Positive Rate')
  15. plt.title('ROC curve')
  16. plt.legend(loc="lower right")
  17. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement