混淆矩阵指标

🔢 Confusion Matrix Metrics (MCC / FPR)

Enter TP / FP / FN / TN to get the Matthews correlation coefficient and false positive rate, two metrics that stay informative on imbalanced data.

📐 计算公式 / 原理
MCC = (TP·TN − FP·FN)/√[(TP+FP)(TP+FN)(TN+FP)(TN+FN)];FPR = FP/(FP+TN);TNR = TN/(FP+TN);FDR = FP/(TP+FP)
MCC 同时用到混淆矩阵四格,取值 [−1,1],0 表示与随机猜测相当,在不平衡数据上比准确率稳健。FDR 回答"报为正的结果里有多少是误报",与精确率互补(P = 1 − FDR),常用于多重假设检验的校正判读。

📐 计算公式与说明

MCC = (TP·TN − FP·FN) / √[(TP+FP)(TP+FN)(TN+FP)(TN+FN)]
FPR = FP/(FP+TN)

MCC 范围 [−1,1],是均衡的评估指标。

📚 深度解析:混淆矩阵指标

💡 常见使用场景

不平衡二分类
TP=80, FP=20, FN=10, TN=890:准确率=(80+890)/1000=97%,但 MCC=(80×890−20×10)/√(100×90×910×900)=71000/√7371000000≈0.827,FPR=20/(20+890)=2.2%。

❓ 常见问题(FAQ)

为什么准确率高分却不可信?
正负样本极不平衡时全猜负类也能得高准确率。MCC 同时用四类计数,能暴露这种假象,是更稳健的单一指标。
FPR 和 FNR 有何不同?
FPR=FP/(FP+TN) 是负类误判率;FNR=FN/(FN+TP) 是漏检率。医学筛查通常压低 FNR(少漏诊),反垃圾则压低 FPR(少误杀)。

Formula & Standard References

Item Formula / Note Source / Standard
Precision and recall precision divides by predicted positives and recall by actual positives Classification metrics practice
F1 score F1 is the harmonic mean of precision and recall Classification metrics practice
Matthews coefficient MCC spans minus one to one and suits imbalanced classes Matthews 1975