特异度计算

🧮 Specificity Calculator

Compute specificity from true negatives and false positives to measure how well a model recognises the negative class. Complements sensitivity.

📐 计算公式 / 原理
特异度 TNR = TN/(TN+FP)×100%;假阳性率 FPR = FP/(TN+FP)×100% = 1 − 特异度
特异度衡量负类被正确排除的能力,与召回率(灵敏度)构成 ROC 曲线的两个轴。筛查场景宁可牺牲特异度换取高召回,而 spam 误杀正常邮件的代价很高,应反过来优先保特异度。

📐 计算公式与说明

特异度判读(与上式互补,负类专用指标):特异度 TNR=TN÷(TN+FP)×100%,衡量负类被正确排除的能力;假阳性率 FPR=FP÷(TN+FP)×100%=1−特异度,两者互补;页面另给负类占比=(TN+FP)÷样本总数×100%。校验:无强校验,空值按 0 兜底;结果非有限时提示「部分结果无定义(分母为 0 或输入为空)」。判据:无固定分级,特异度越高负类误报越少,分母 TN+FP=0 时无定义。

特异度衡量模型识别负类的能力。

📚 深度解析:特异度计算

💡 常见使用场景

筛查特异度
TN=900, FP=30 → 特异度=900/930=96.8%,即健康人被 correctly 判为健康的比例;若 FP 升到 100 则特异度降到 90%,假阳性增多。

❓ 常见问题(FAQ)

特异度和精确率有什么区别?
特异度=TN/(TN+FP) 站在负类视角;精确率=TP/(TP+FP) 站在预测为正视角。二者分母不同,关注点不同。
为什么筛查要重视特异度?
假阳性会引不必要的复查与焦虑、浪费资源;高特异度减少误报,但常与灵敏度权衡(卡阈值时此消彼长)。

Formula & Standard References

Item Formula / Note Source / Standard
Specificity formula specificity is true negatives over true negatives plus false positives ISO/IEC 22989:2022 AI concepts
Complement of sensitivity specificity and sensitivity describe negative and positive class detection and are reported together Altman & Bland 1994, BMJ
Screening meaning low specificity means many false positives which inflate re-test burden in screening STARD 2015 reporting guideline