Created
January 24, 2024 04:45
-
-
Save wibowotangara/9e74ea17b9fbf9131007133a07f345fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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