You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from sklearn.metrics import roc_curve, auc
p = np.array([3E-011, 5E-11, 2E-010, 1E-008, 2E-006, 1.29E-005, 0.0003, 0.1, 0.2, 0.3, 0.46])
p = np.expand_dims(p, axis=1)
y = np.array([0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1])
fpr, tpr, thresholds = roc_curve(y, p, pos_label=1)
roc_auc = auc(fpr, tpr)
with these values it should be 0.9333333 (I checked it in R), but sklearn gives 0.883333333333.
If I rescale p with MinMaxScaler(), I get the right answer.
I also noticed that it has different number of n_thresholds:
in the first case n_thresholds=8, and when I scale the probabilities n_thresholds=9.
Thank you very much for considering this problem!
Activity
jnothman commentedon Dec 10, 2014
duplicate of #3864.