最近用得比较频繁,写一份速查笔记。
早先在周志华《机器学习》上读到过,那时候印象还不深刻,如有写错请大家斧正。
1 概念
1.1 图例
1.2 混淆矩阵
Confusion Matrix |
Prediction | |||||
---|---|---|---|---|---|---|
Positive | Negative | Total | ||||
Reality | Positive | TP True Positive |
![]() |
FN False Negative |
![]() |
ReaP |
Negative | FP False Positive |
![]() |
TN True Negative |
![]() |
ReaN | |
Total | PreP | PreN | All |
ReaP、ReaN、PreP、PreN 不是通用表达,是本文自定义的名称。
1.3 快速理解
Quickly, think about how to tell one from another.
See yourself as the predictive model, and say these:
- TP, true positive, which is actually positive, and I thought it’s positive → .
- FN, false negative, which is actually positive, but I thought it’s negative → .
- FP, false positive, which is actually negative, but I thought it’s positive → .
- TN, true negative, which is actually nagetive, and I thought it’s negative → .
2 指标
2.1 指标矩阵
在混淆矩阵基础上计算。
Prediction | - | ||||
---|---|---|---|---|---|
Positive | Negative | ||||
Reality | Positive | TP | FN | R, S, TPR TP/ReaP |
MR, FNR FN/ReaP |
Negative | FP | TN | FPR FP/ReaN |
SPC, TNR TN/ReaN |
|
LR+ TPR/FPR |
P, PPV TP/PreP |
FOR FN/PreN |
ACC (TP+TN)/All |
- | |
LR- FNR/TNR |
FDR FP/PreP |
NPV TN/PreN |
- | - |
2.2 指标说明
2.2.1 召回率 ★
召回率(R、Recall)、灵敏度(S、Sensitivity)、真正类率(TPR、True Positive Rate)。
事实真值中,模型发现了多少个真值,衡量发现能力。
![]() |
|
---|---|
2.2.2 精确率 ★
精确率(P、Precision)、阳性预测值(PPV、Positive Precision Value)。
模型真值中,有多少是事实真值,衡量判断正确性。
![]() |
|
---|---|
2.2.3 F1-Measure ★
F1-Measure。
Fβ-Measure 当 β=1 时的特殊形式,是 P 和 R 的调和平均数,综合衡量 P 和 R。
![]() |
2.2.4 准确率
准确率(ACC、Accuracy)。
衡量模型判断正确的比率。
![]() |
|
---|---|
2.2.5 假正类率
假正类率(FPR、False Positive Rate)。
![]() |
|
---|---|
2.2.6 SPC & TNR
SPC(Specificity)、TNR(True Negative Rate)。
![]() |
|
---|---|
2.2.7 Miss Rate & FNR
Miss Rate、FNR(False Negative Rate)。
![]() |
|
---|---|
2.2.8 FDR
FDR(False Discovery Rate)。
![]() |
|
---|---|
2.2.9 回溯精确度
回溯精确度、阴性预测值(NPV、Negative Predictive Value)。
![]() |
|
---|---|
2.2.10 FOR
FOR(False Omission Rate)。
![]() |
|
---|---|
2.2.11 LR+
LR+(Positive Likelihood Ratio)。
2.2.12 LR-
LR-(Negative Likelihood Ratio)。
2.2.13 Fβ-Measure
Fβ-Measure。
β 衡量了 P 相对于 R 的重要程度,β > 1 时 P 更重要,β = 1 时二者重要程度相同,β < 1 时 R 更重要。