auc roc
from sklearn.metrics import roc_curve, roc_auc_score import matplotlib.pyplot as plt # Compute ROC curve fpr, tpr, thresholds = roc_curve(y_test, y_pred) # Compute AUC roc_auc = roc_auc_score(y_test, y_pred) # Plot ROC curve plt.figure() plt.plot(fpr, tpr, label='Logistic Regression (area = %0.2f)' % roc_auc) plt.plot([0, 1], [0, 1],'r--') plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate') plt.title('Receiver Operating Characteristic') plt.legend(loc="lower right") plt.show()