sklearn学习:roc_auc曲线和 metrics.roc_auc_score

1.概念

ROC(Receiver Operating Characteristic)曲线和AUC常被用来评价一个二值分类器(binary classifier)的优劣。

AUC(Area Under Curve)被定义为ROC曲线下的面积,显然这个面积的数值不会大于1。又由于ROC曲线一般都处于y=x这条直线的上方,所以AUC的取值范围在0.5和1之间。使用AUC值作为评价标准是因为很多时候ROC曲线并不能清晰的说明哪个分类器的效果更好,而作为一个数值,对应AUC更大的分类器效果更好。

2. metrics.roc_auc

sklearn.metrics.roc_curve(y_true, y_score, pos_label=None, sample_weight=None, drop_intermediate=True)

计算ROC值,仅用于二值分类器。

要注意到的参数
pos_label
Label considered as positive and others are considered negative.

此处官方文档,具体意思现在还不是很懂,先存下来
返回值
fpr
array, Increasing false positive rates

tpr
array, Increasing true positive rates

thresholds
array, Decreasing thresholds on the decision function used to compute fpr and tpr.

未完待续……


下面是摘抄和参考的链接们:

official website of roc_curve:
http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html

扫描二维码关注公众号,回复: 1910480 查看本文章

csdn上一个很好的解释
https://blog.csdn.net/shenxiaoming77/article/details/72627882

另一个参考文章
http://alexkong.net/2013/06/introduction-to-auc-and-roc/

猜你喜欢

转载自blog.csdn.net/ninnyyan/article/details/80592664
今日推荐