Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 24, 2024 04:45
Show Gist options
  • Save wibowotangara/9e74ea17b9fbf9131007133a07f345fd to your computer and use it in GitHub Desktop.
Save wibowotangara/9e74ea17b9fbf9131007133a07f345fd to your computer and use it in GitHub Desktop.
from sklearn.metrics import roc_curve, roc_auc_score
fpr, tpr, tr = roc_curve(df_actual_predicted['y_actual'], df_actual_predicted['y_pred_proba'])
auc = roc_auc_score(df_actual_predicted['y_actual'], df_actual_predicted['y_pred_proba'])
plt.plot(fpr, tpr, label='AUC = %0.4f' %auc)
plt.plot(fpr, fpr, linestyle = '--', color='k')
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('ROC Curve')
plt.legend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment