thebench.bio #1 Ecosystem for the Bio-Tech Industry
All Model Evaluation questions

Question 7 of 20 Fundamentals Concept

How do sensitivity, specificity, precision and recall relate to the confusion matrix?

Short answer

From the four cells of a confusion matrix, sensitivity, also called recall, is true positives over all actual positives, and specificity is true negatives over all actual negatives. Precision, also called positive predictive value, is true positives over all predicted positives, so it depends on prevalence while sensitivity and specificity do not.

Why

A binary classifier's results fall into true positives, false positives, true negatives and false negatives. Sensitivity answers how many of the people who have the condition the test catches. Specificity answers how many of those without it are correctly cleared.

Precision answers a different question: of those flagged, how many truly have it. The scikit-learn guide puts it as precision being the ability not to label a negative sample as positive, and recall the ability to find all positive samples. Clinical and machine learning communities use different names for the same quantities, which causes confusion in meetings, so define terms once.

Consider 1,000 samples with 100 positives. A model catching 80 of them with 90 false alarms has sensitivity 0.80, specificity 810 out of 900, or 0.90, and precision 80 out of 170, about 0.47. Trevethan's review stresses that these values are not fixed attributes of a test.

They depend on the threshold chosen and on the population, and predictive values move with prevalence. F1 combines precision and recall into one number but ignores true negatives and hides which error dominates. Report the full confusion matrix at the chosen threshold alongside any summary.

A strong answer covers

  • Sensitivity equals recall, TP over actual positives
  • Specificity is TN over actual negatives
  • Precision equals PPV, TP over predicted positives
  • Precision depends on prevalence
  • Report the full matrix at a stated threshold

Common mistakes

  • Treating precision and sensitivity as interchangeable
  • Quoting F1 alone when false negatives and false positives have very different costs