【发布时间】:2021-05-22 11:16:02
【问题描述】:
我假设roc_curve() 为每个阈值计算 fpr 和 tpr。
但是下面的代码显示fpr和thresholds有不同的维度。
from sklearn.metrics import roc_curve
fpr,tpr,thresholds = roc_curve(y_train_5,y_scores)
fpr.shape #(3908,)
thresholds.shape #(59966,)
我也想知道为什么
precisions,recalls,thresholds = precision_recall_curve(y_train_5,y_scores)
precisions #(59967,)
thresholds #(59966,)
precisions 的维度与 thresholds' 相差 1?
【问题讨论】:
标签: machine-learning scikit-learn roc