注:本文是人工智能研究网的学习笔记学习
最好的预测模型在左上角,表明100%的灵敏度和0%的虚警率,被称为完美分类器。人工智能
一个随机猜想模型。会给出从左下角到右上角的沿着对角线的点(对角线被称做line of no-discrimation)。3d
对角线上的的点表明了好的分配结果,对角线如下的点表明很差的分配结果,可是能够经过翻转变成好的分类器。code
当曲线差很少时,求面积, 新的研究表名,AUC曲线存在一些问题。blog
metrics.roc_curve(y_true, y_score, pos_label=None, sample_weight=None, drop_intermediate=True)
参数:get
返回值:io
from sklearn.metrics import roc_curve,roc_auc_score y = np.array([1,1,2,2]) scores = np.array([0.1, 0.4, 0.35, 0.8]) fpr, tpr, thresholds = roc_curve(y, scores, pos_label=2) print(fpr) print(tpr) print(thresholds)