Specificity
Specificity is the fraction of observed negative cases correctly classified as negative at a specified decision threshold.
Specificity = TN / (TN + FP) = 1 - FPR when observed negatives exist. TN counts correct negative decisions and FP counts false positive decisions. The denominator is all observed negatives, not all negative predictions. [1]
Negative predictive value instead uses TN / (TN + FN), conditioning on predictions. In the synthetic matrix [[9801, 99], [10, 90]] with observed labels in rows, specificity is 9801/9900 = 99%, while negative predictive value is 9801/9811, about 99.90%. [2] [3]
A classifier that never raises an alarm has specificity 100% but recall 0% when both classes occur. With no observed negatives, specificity is undefined; a reporting convention that substitutes a number cannot establish negative-class performance. [1] [3]
High specificity does not determine precision or alarm workload. At the same 1% FPR, ten times as many observed negative decisions produce ten times as many false alerts. Report the count, threshold and decision unit alongside the rate. [3]
Relations
- related
- Confusion matrix, Balanced accuracy, False positive rate, Recall, Precision, Class prevalence
Citations
- Fawcett (2006). An introduction to ROC analysis, section 2 and Figure 1. DOI: 10.1016/j.patrec.2005.10.010.
- scikit-learn: confusion_matrix; axis conventions, label order and normalization.
- Hesela: synthetic classification counts, exact fractions and edge-case checks.
Sources & caveats
- Reviewed 2026-11-22: Fawcett section 2 for specificity and its complement; scikit-learn for explicit matrix orientation.
- Negative predictive value and the synthetic examples follow directly from labelled counts; no fleet estimate or confidence interval is implied.