sklearn.metrics
.roc_auc_score(y_true,y_score)
y_true:真实标签的类别值;
y_scores:target scores,或者预测的正类标签的概率值;对于二进制y_true,y_score应该是类别中最大值的scores。
sklearn.metrics
.roc_curve(y_true,y_score,pos_label)
y_true:真实标签的类别值;
y_scores:target scores,或者预测的正类标签的概率值;
pos_label:真实标签中正类标签的类别值,除该值外其余为负类标签。
返回值为TPR,FPR,threshold。
sklearn.metrics
.auc(x, y)
一般结合metrics.roc_curve函数使用。
x:FPR值;
y:TPR值。
sklearn.metrics
.roc_curve(y_true, y_score, pos_label)
y_true:真实标签的类别值;
y_scores:target scores,或者预测的正类标签的概率值;
pos_label:真实标签中正类标签的类别值,除该值外其余为负类标签。