Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- from sklearn.metrics import roc_curve, auc,recall_score,precision_score
- fpr, tpr, _ = roc_curve(y_test, pred)
- roc_auc = auc(fpr, tpr)
- plt.figure()
- lw = 2
- plt.plot(fpr, tpr, color='orange',
- lw=lw, label='AUC = %0.4f' % roc_auc)
- plt.plot([0, 1], [0, 1], color='steelblue', lw=lw, linestyle='--')
- plt.xlim([-0.02, 1.0])
- plt.ylim([0.0, 1.05])
- plt.xlabel('False Positive Rate')
- plt.ylabel('True Positive Rate')
- plt.title('ROC curve')
- plt.legend(loc="lower right")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement