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

  最近一直在看ROC曲线,查阅了一些资料,并进行了整理,文章结尾有原资料链接。希望能节约各位找资料的时间。
ROC(Receiver Operating Characteristic)曲线和AUC常被用来评价一个二值分类器(binary classifier)的优劣 。ROC曲线怎么来的呢,我们来看经典的混淆矩阵:
ROC曲线以及评估指标F1-Score, recall, precision-整理版_第1张图片

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

ROC曲线以及评估指标F1-Score, recall, precision-整理版_第2张图片
当然还有其他的一些评估指标,常见的有: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


以下是指标的介绍:感觉原博主讲的很好,我就不作修改了,复制粘贴排版会乱,就直接截图了。
ROC曲线以及评估指标F1-Score, recall, precision-整理版_第3张图片
ROC曲线以及评估指标F1-Score, recall, precision-整理版_第4张图片
ROC曲线以及评估指标F1-Score, recall, precision-整理版_第5张图片
参考来源:
http://www.w2bc.com/Article/88963
https://en.wikipedia.org/wiki/Receiver_operating_characteristic

你可能感兴趣的:(机器学习(python))