Last active
March 17, 2019 03:07
-
-
Save JulianaGuama/1b76a4907193445b01320ad2b8a4dc4e to your computer and use it in GitHub Desktop.
ROC Python
This file contains hidden or 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
#https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html | |
from sklearn.metrics import roc_curve | |
y_true = np.array([1, 1, 2, 2]) | |
y_pred = np.array([0.1, 0.4, 0.35, 0.8]) | |
#pos_label é onde indica-se o valor da classe de interesse | |
fpr, tpr, thresholds = metrics.roc_curve(y, scores, pos_label=2) | |
print(fpr) | |
#>>>array([0. , 0. , 0.5, 0.5, 1. ]) | |
print(tpr) | |
#>>>array([0. , 0.5, 0.5, 1. , 1. ]) | |
print(thresholds) | |
#>>>array([1.8 , 0.8 , 0.4 , 0.35, 0.1 ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment