I assume that roc_curve()
computes fpr and tpr for each value of thresholds.
But the following code shows that fpr and thresholds have different dimensions.
from sklearn.metrics import roc_curve
fpr,tpr,thresholds = roc_curve(y_train_5,y_scores)
fpr.shape #(3908,)
thresholds.shape #(59966,)
I am also wondering why
precisions,recalls,thresholds = precision_recall_curve(y_train_5,y_scores)
precisions #(59967,)
thresholds #(59966,)
precisions's dimension differs from thresholds' by one?