分类准确率评估

📋 Classification Accuracy Evaluator

Enter TP / FP / FN / TN from a confusion matrix to get accuracy, precision, recall and F1 for a binary classifier. Everything runs locally in the browser.

📐 计算公式 / 原理
准确率 = (TP+TN)/(TP+FP+FN+TN)×100%;精确率 = TP/(TP+FP)×100%;召回率 = TP/(TP+FN)×100%;F1 = 2TP/(2TP+FP+FN)×100%
由混淆矩阵四类计数推导:准确率衡量整体判对比例,精确率关注"报为正的有多少真",召回率关注"真正例被找出多少",F1 是二者调和平均。样本极度不平衡时准确率会失真,应改看 F1 或 PR 曲线下的面积。

📐 计算公式与说明

Accuracy = (TP+TN)/All
Precision = TP/(TP+FP)
Recall = TP/(TP+FN)
F1 = 2·P·R/(P+R)

用于二分类模型评估。

📚 深度解析:分类准确率评估

💡 常见使用场景

二分类四指标
TP=70, FP=10, FN=20, TN=100:准确率=(70+100)/200=85%,P=70/80=87.5%,R=70/90=77.8%,F1=2×0.875×0.778/(0.875+0.778)≈82.4%。

❓ 常见问题(FAQ)

准确率 85% 算好吗?
取决于基线。若正类仅占 10%,全猜负类就有 90% 准确率却毫无正类识别力;此时应看精确率/召回/F1 与 PR 曲线。
多分类怎么算精确率?
常用宏平均(各类指标等权平均,看重小类)或微平均(汇总所有 TP/FP/FN,等价于整体准确率),按业务对小类敏感度选择。

Formula & Standard References

Item Formula / Note Source / Standard
Accuracy accuracy = correct predictions / total samples Classification metrics practice
Imbalance trap predicting all negatives still scores high when positives are rare Classification metrics practice
Alternatives balanced accuracy, F1 and AUC are safer under imbalance Classification metrics practice