Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.metrics import roc_auc_score, auc
- from sklearn.metrics import roc_curve
- roc_log = roc_auc_score(np.argmax(Y_test, axis=1), np.argmax(Y_pred_tta, axis=1))
- false_positive_rate, true_positive_rate, threshold = roc_curve(np.argmax(Y_test, axis=1), np.argmax(Y_pred_tta, axis=1))
- area_under_curve = auc(false_positive_rate, true_positive_rate)
- plt.plot([0, 1], [0, 1], 'r--')
- plt.plot(false_positive_rate, true_positive_rate, label='AUC = {:.3f}'.format(area_under_curve))
- plt.xlabel('False positive rate')
- plt.ylabel('True positive rate')
- plt.title('ROC curve')
- plt.legend(loc='best')
- plt.show()
- #plt.savefig(ROC_PLOT_FILE, bbox_inches='tight')
- plt.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement