{
  "slug": "specificity",
  "term": "Specificity",
  "aliases": [
    "true negative rate",
    "TNR"
  ],
  "definition": "Specificity is the fraction of observed negative cases correctly classified as negative at a specified decision threshold.",
  "note": "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. [fawcett]\n\nNegative 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%. [matrix-api] [worked]\n\nA 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. [fawcett] [worked]\n\nHigh 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. [worked]",
  "related": [
    "confusion-matrix",
    "balanced-accuracy",
    "false-positive-rate",
    "recall",
    "precision",
    "class-prevalence"
  ],
  "citations": [
    {
      "id": "fawcett",
      "title": "Fawcett (2006). An introduction to ROC analysis, section 2 and Figure 1. DOI: 10.1016/j.patrec.2005.10.010.",
      "url": "https://www.math.ucdavis.edu/~saito/data/roc/fawcett-roc.pdf",
      "accessed": "2026-11-22"
    },
    {
      "id": "matrix-api",
      "title": "scikit-learn: confusion_matrix; axis conventions, label order and normalization.",
      "url": "https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html",
      "accessed": "2026-11-22"
    },
    {
      "id": "worked",
      "title": "Hesela: synthetic classification counts, exact fractions and edge-case checks.",
      "url": "https://hesela.dev/research/classification-denominators/results.json",
      "accessed": "2026-11-22"
    }
  ],
  "provenance": [
    "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."
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-22"
}
