ROC曲线以及评估指标F1-Score, recall, precision-整理版

来源:互联网 发布:ubuntu开机黑屏 编辑:程序博客网 时间:2024/06/07 03:58
  最近一直在看ROC曲线,查阅了一些资料,并进行了整理,文章结尾有原资料链接。希望能自己和各位节约时间来找资料,花更多的时间来学习。
ROC(Receiver Operating Characteristic)曲线和AUC常被用来评价一个二值分类器(binary classifier)的优劣 。ROC曲线怎么来的呢,我们来看经典的混淆矩阵:

ROC曲线一般的横轴是FPR,纵轴是FPR。AUC为曲线下面的面积,作为评估指标,AUC值越大,说明模型越好。如下图:

File:Roccurves.png
当然还有其他的一些评估指标,常见的有:ROC、AUC、precision、recall、F1-score。下面是指标详细:

Terminology and derivations
from a confusion matrix
true positive (TP)
eqv. with hit
true negative (TN)
eqv. with correct rejection
false positive (FP)
eqv. with false alarm, Type I error
false negative (FN)
eqv. with miss, Type II error

sensitivity or true positive rate (TPR)
eqv. with hit rate, recall
\mathit{TPR} = \frac {\mathit{TP}} {P} = \frac {\mathit{TP}} {\mathit{TP}+\mathit{FN}}
specificity (SPC) or true negative rate (TNR)
\mathit{SPC} = \frac {\mathit{TN}} {N} = \frac {\mathit{TN}} {\mathit{FP} + \mathit{TN}}
precision or positive predictive value (PPV)
\mathit{PPV} = \frac {\mathit{TP}} {\mathit{TP} + \mathit{FP}}
negative predictive value (NPV)
\mathit{NPV} = \frac {\mathit{TN}} {\mathit{TN} + \mathit{FN}}
fall-out or false positive rate (FPR)
\mathit{FPR} = \frac {\mathit{FP}} {N} = \frac {\mathit{FP}} {\mathit{FP} + \mathit{TN}} = 1 - \mathit{SPC}
false discovery rate (FDR)
\mathit{FDR} = \frac {\mathit{FP}} {\mathit{FP} + \mathit{TP}} = 1 - \mathit{PPV}
miss rate or false negative rate (FNR)
\mathit{FNR} = \frac {\mathit{FN}} {P} = \frac {\mathit{FN}} {\mathit{FN} + \mathit{TP}}

accuracy (ACC)
\mathit{ACC} = \frac {\mathit{TP} + \mathit{TN}} {P + N}
F1 score
is the harmonic mean of precision and sensitivity
\mathit{F1} = \frac {2 \mathit{TP}} {2 \mathit{TP} + \mathit{FP} + \mathit{FN}}
Matthews correlation coefficient (MCC)
 \frac{ TP \times TN - FP \times FN } {\sqrt{ (TP+FP) ( TP + FN ) ( TN + FP ) ( TN + FN ) } }

Informedness = Sensitivity + Specificity - 1
Markedness = Precision + NPV - 1


以下是指标的介绍:感觉原博主讲的很好,我就不作修改了,复制粘贴排版会乱,就直接截图了。



参考来源:
http://www.w2bc.com/Article/88963
https://en.wikipedia.org/wiki/Receiver_operating_characteristic
0 0
原创粉丝点击