Skip to main content
v2026.11,986 entries · CC-BY 4.0

Direct comparison

Precision & Recall vs Sensitivity & Specificity

Compare precision and recall vs sensitivity and specificity. Learn why recall equals sensitivity, how true negatives alter curves, and when to choose each.

Written and maintained by CASRAI Editorial Board

Last updated

How do Precision & Recall (Information Retrieval & Machine Learning) and Sensitivity & Specificity (Diagnostic Medicine & Biostatistics) compare side by side?

The table below compares Precision & Recall (Information Retrieval & Machine Learning) and Sensitivity & Specificity (Diagnostic Medicine & Biostatistics) across 11 dimensions, from disciplinary origin & core paradigms to worked example: severe imbalance (0.1% rare condition rate).

Side-by-side comparison

DimensionPrecision & Recall (Information Retrieval & Machine Learning)Sensitivity & Specificity (Diagnostic Medicine & Biostatistics)
Disciplinary Origin & Core ParadigmsOriginating in 1960s information retrieval through the Cranfield tests and formalized by Cyril Cleverdon and C.J. van Rijsbergen (1979), precision and recall were engineered to assess document retrieval systems. The paradigm assumes that in large-scale databases, the volume of irrelevant, unretrieved documents (true negatives) is vast, unmeasured, or practically infinite. The analytical focus rests strictly on retrieved results and relevant targets.Formulated in clinical biostatistics and diagnostic epidemiology by Jacob Yerushalmy in 1947 for evaluating chest photofluorography in tuberculosis screening, sensitivity and specificity assess the intrinsic discriminative validity of diagnostic assays. The paradigm requires defining both diseased and non-diseased target populations under explicit clinical reference standards, treating condition absence with equal importance.
Core Mathematical Formulas & DefinitionsRecall equals True Positives divided by total actual condition positives: TP / (TP + FN), measuring the fraction of target cases captured. Precision equals True Positives divided by all predicted positives: TP / (TP + FP), measuring positive prediction purity. The combined harmonic mean is expressed as the F1-score: 2 * (Precision * Recall) / (Precision + Recall).Sensitivity equals True Positives divided by total actual condition positives: TP / (TP + FN), mathematically identical to recall. Specificity equals True Negatives divided by total actual condition negatives: TN / (TN + FP), measuring the proportion of healthy or control subjects correctly cleared. False Positive Rate is the complement: 1 - Specificity = FP / (TN + FP).
Treatment of True Negatives (TN Invariance)Completely invariant to True Negatives. Neither precision nor recall includes TN in its denominator or numerator. Adding one billion true negative instances to an evaluation dataset leaves both precision and recall entirely unchanged, isolating model assessment from arbitrary negative cohort scale.Directly dependent on True Negatives. Specificity has TN in both the numerator and denominator: TN / (TN + FP). Consequently, adding large numbers of true negatives causes specificity to approach 1.0 (100%), even if hundreds of false positive errors occur in practice.
Prevalence Dependence & Population ShiftPrecision (Positive Predictive Value) is heavily dependent on population prevalence. Even with high sensitivity and specificity, precision plummets when disease prevalence is low. Recall is prevalence-invariant because it evaluates only condition-positive cases. Precision-recall curves change shape when test class ratios shift.Both sensitivity and specificity are intrinsic operational characteristics of the diagnostic assay. Under stable clinical spectrum conditions, sensitivity and specificity remain constant regardless of whether disease prevalence is 0.1% or 50%, enabling multi-site trial comparisons.
Curve Space: PR Curves vs. ROC AnalysisPrecision-Recall curves (PRC) plot Precision on the y-axis against Recall on the x-axis across classification thresholds. As demonstrated by Saito and Rehmsmeier (2015), PR curves provide superior visual and quantitative separation on imbalanced datasets because precision penalizes false positive inflation.Receiver Operating Characteristic (ROC) curves plot Sensitivity (TPR) on the y-axis against 1 - Specificity (FPR) on the x-axis. Because the FPR denominator includes all true negatives (TN + FP), massive negative classes keep FPR near zero, creating deceptively high Area Under the Curve (AUC-ROC) values.
Decision Thresholds & Optimization CriteriaThreshold selection focuses on balancing retrieval coverage against prediction purity using the parameterized F-beta score: (1 + beta^2) * (Precision * Recall) / ((beta^2 * Precision) + Recall). Setting beta = 2 weights recall higher (e.g., search discovery), while beta = 0.5 prioritizes precision (e.g., automated execution).Threshold selection balances diagnostic sensitivity against false positive triage costs using Youden's J index: J = Sensitivity + Specificity - 1, or diagnostic likelihood ratios. High-sensitivity thresholds rule out conditions (SnNOut), whereas high-specificity thresholds rule in conditions (SpPIn).
Asymmetric Error Costs & Risk ProfilesEngineered for workflows where retrieving non-relevant items (FP) causes mild user friction or extra manual screening, but missing rare relevant instances (FN) degrades system utility. In web search, user attention drops beyond the first page, demanding high top-k precision.Engineered for clinical workflows where a False Negative represents a missed fatal illness (preventing timely clinical intervention), while a False Positive triggers invasive follow-up diagnostic procedures, emotional trauma, and substantial medical costs.
Multiclass & Multi-Label ExtensionsCalculated across multiple classes via micro-averaging (aggregating global TP, FP, FN counts), macro-averaging (computing unweighted arithmetic mean across classes), or weighted averaging (weighting each class metric by actual positive support). Commonly evaluated in hierarchical multi-label tagging.Evaluated primarily in binary one-versus-rest diagnostic screening. In multi-category differential diagnosis, sensitivity and specificity are reported separately for each distinct pathology against normal and competing disease control cohorts.
Regulatory Standards & Reporting GuidelinesGoverned by National Institute of Standards and Technology (NIST) TREC evaluation protocols, IEEE computational standards, and machine learning reporting frameworks. Evaluates Mean Average Precision (MAP), normalized Discounted Cumulative Gain (nDCG), and Area Under the PR Curve (AUPRC).Mandated by FDA Center for Devices and Radiological Health (CDRH 2007) diagnostic guidance and the STARD 2015 statement (Standards for Reporting Diagnostic Accuracy Studies). Regulators require reporting paired sensitivity and specificity with two-sided 95% confidence intervals against validated reference standards.
Worked Example: Balanced Population (50% Condition Rate)In a balanced cohort of 1,000 cases and 1,000 controls, a test producing TP = 900, FN = 100, TN = 900, FP = 100 achieves Recall = 900 / 1000 = 90.0% and Precision = 900 / 1000 = 90.0%. The F1-score equals 90.0%, reflecting balanced, high-performing identification under equal class frequencies.In the same balanced cohort of 1,000 cases and 1,000 controls with identical counts, Sensitivity equals 900 / 1000 = 90.0% and Specificity equals 900 / 1000 = 90.0%. Balanced accuracy equals (Sensitivity + Specificity) / 2 = 90.0%, confirming symmetric diagnostic capability across both classes.
Worked Example: Severe Imbalance (0.1% Rare Condition Rate)In a screening population of 100 cases and 99,900 controls (0.1% prevalence), the same 90% test generates TP = 90, FN = 10, TN = 89,910, FP = 9,990. Recall remains 90.0% (90 / 100). However, Precision collapses to 90 / (90 + 9990) = 0.89%. Less than 1% of positive alerts are true positives, exposing severe operational false-alarm burden.In the exact same imbalanced population of 100 cases and 99,900 controls, Sensitivity remains 90.0% (90 / 100) and Specificity remains 90.0% (89,910 / 99,900). ROC-AUC remains unchanged, completely concealing the fact that out of 10,080 individuals flagged positive, 9,990 are healthy individuals requiring false-positive resolution.

Ask CASRAI · full access

Ask about Precision & Recall vs Sensitivity & Specificity

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Common questions

Common questions about Precision & Recall (Information Retrieval & Machine Learning) vs Sensitivity & Specificity (Diagnostic Medicine & Biostatistics)

Is specificity equal to recall?

+

No, specificity is not equal to recall. Recall measures the proportion of actual condition positives correctly identified (TP / (TP + FN)), which is mathematically identical to sensitivity. In contrast, specificity measures the proportion of actual condition negatives correctly identified (TN / (TN + FP)). Specificity focuses on healthy or non-target subjects, while recall focuses entirely on positive condition cases.

What does accuracy 1.0 mean?

+

An accuracy of 1.0 (or 100%) means that every single prediction made by the classification model or diagnostic test was completely correct across the entire evaluated cohort. In terms of the confusion matrix, this occurs when False Positives (FP) equal zero and False Negatives (FN) equal zero, leaving only True Positives (TP) and True Negatives (TN). Under an accuracy of 1.0, precision, recall, sensitivity, and specificity all simultaneously equal 1.0. However, in practical machine learning and clinical testing, an accuracy of 1.0 usually indicates severe model overfitting, evaluation on synthetic data, or extreme data leakage between training and testing splits.

Is 0.7 accuracy good?

+

Whether an accuracy of 0.7 (70%) is acceptable depends entirely on class balance and the operational baseline. On a balanced binary dataset where positive and negative instances each represent 50% of the sample, 70% accuracy represents a meaningful 20 percentage point improvement over random guessing. However, on an imbalanced dataset where 95% of cases are negative, a naive baseline classifier predicting all instances as negative would achieve 95% accuracy; in that context, 70% accuracy indicates severe failure. In clinical diagnostics, 70% accuracy is generally considered marginal or unacceptable unless paired with high sensitivity in exploratory triage.

What is TP FP TN FN?

+

TP, FP, TN, and FN are the four fundamental quadrants of a binary confusion matrix. True Positives (TP) represent instances where the true condition is positive and the test correctly predicts positive. False Positives (FP), also called Type I errors, represent instances where the true condition is negative but the test incorrectly predicts positive. True Negatives (TN) represent instances where the true condition is negative and the test correctly predicts negative. False Negatives (FN), also called Type II errors, represent instances where the true condition is positive but the test incorrectly predicts negative.

Why do precision and recall ignore true negatives?

+

Precision and recall deliberately omit True Negatives (TN) because they were developed for information retrieval and sparse document indexing where the negative class is practically infinite or undefined. In web search, for example, billions of web pages are irrelevant to a user query. Counting unretrieved irrelevant web pages as true negatives would overwhelm the evaluation metrics, making standard false positive rates meaningless. By restricting evaluation formulas strictly to TP, FP, and FN, precision and recall isolate the relevance and coverage of retrieved items regardless of repository scale.

When should you use a Precision-Recall curve instead of an ROC curve?

+

You should use a Precision-Recall (PR) curve instead of a Receiver Operating Characteristic (ROC) curve whenever evaluating classification models on imbalanced datasets where the positive class is rare (such as fraud detection, disease outbreak surveillance, anomaly detection, or genomic sequence identification). On imbalanced datasets, ROC curves present an overly optimistic assessment because the False Positive Rate denominator (TN + FP) is dominated by vast numbers of True Negatives, suppressing FPR. Precision-Recall curves directly contrast Precision against Recall, clearly exposing false-positive contamination.

Data: Binary Classification and Diagnostic Metric Architecture Benchmark

Comparative specification benchmark mapping 8 foundational binary classification and diagnostic performance metrics across mathematical formulations, confusion matrix quadrant dependencies, prevalence invariance properties, and primary disciplinary applications. Compiled from NIST TREC standards, FDA diagnostic guidance, and peer-reviewed biostatistical literature.

Period covered: 2007/2026. Coverage: Global.

Binary Classification and Diagnostic Metric Architecture Benchmark
Metric NameMathematical FormulaMatrix Cells UsedPrevalence InvariantTrue Negative DependentPrimary Discipline
Recall (Sensitivity / True Positive Rate)TP / (TP + FN)TP, FNYesNoInformation Retrieval & Biostatistics
Precision (Positive Predictive Value)TP / (TP + FP)TP, FPNoNoMachine Learning & Diagnostic Medicine
Specificity (True Negative Rate)TN / (TN + FP)TN, FPYesYesClinical Epidemiology & Diagnostic Trials
False Positive Rate (Fall-Out)FP / (TN + FP)TN, FPYesYesSignal Detection Theory & ROC Analysis
Negative Predictive Value (NPV)TN / (TN + FN)TN, FNNoYesClinical Screening & Medical Prognosis
Overall Accuracy(TP + TN) / (TP + FP + TN + FN)TP, FP, TN, FNNoYesGeneral Classification & Quality Control
F1-Score (Harmonic Mean)2 * TP / (2 * TP + FP + FN)TP, FP, FNNoNoNatural Language Processing & ML
Balanced Accuracy((TP / (TP + FN)) + (TN / (TN + FP))) / 2TP, FP, TN, FNYesYesImbalanced Machine Learning & Clinical AI

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →