# Precision and Recall

Precision measures how many predicted positives are correct, while recall measures how many actual positives a system finds.

- Type: metric
- Domain: Data, experimentation & growth
- Level: Intermediate
- Last reviewed: 2026-10-06
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/precision-and-recall/>)

## What it means

For a declared positive class, precision is TP / \(TP + FP\) and recall is TP / \(TP + FN\), where TP means true positives, FP false positives, and FN false negatives. Recall is also called sensitivity or the true positive rate. A confusion matrix counts predicted versus actual classes, making these errors visible. Accuracy includes correct negatives; F1 combines precision and recall as their harmonic mean but does not encode every business consequence.

## Why it matters

Moderation, routing, detection, and retrieval products face different costs for false alarms and missed cases. A high accuracy score can conceal poor detection when positives are rare. The paired measures help teams choose an operating threshold and understand the resulting review workload.

## When to use it

Use these measures when labels or relevance judgments define a meaningful positive result. Compare thresholds on representative held-out data. They do not directly measure the usefulness of an open-ended response without a defined event or rubric.

## How it works

1. Define the positive class, unit of evaluation, reference labels, and consequences of each error.
2. Count true positives, false positives, false negatives, and true negatives at the chosen threshold.
3. Calculate precision and recall, reporting denominators and an explicit convention when a denominator is zero.
4. Compare candidate thresholds against acceptable misses, false alarms, and review capacity.
5. Report class and segment results alongside uncertainty, and retest when prevalence or user behavior changes.

## A practical example

In an illustrative abuse-review queue, 100 messages are flagged and 80 are confirmed abusive. The evaluation sample contains 120 abusive messages overall. Precision is 80%, recall is about 67%, and 40 abusive messages were missed. The PM evaluates whether a lower threshold catches enough additional abuse to justify the extra review load.

## Where it breaks

Results depend on label quality, the population, and the threshold. Precision changes with class prevalence even when sensitivity and specificity remain stable. Aggregate or weighted averages can hide failures on rare classes. F1 omits true negatives and may reward a balance that does not match product risk.

## Common mistakes

- Reporting accuracy alone for a rare positive class.
- Treating recall as the percentage of flagged items that are correct.
- Choosing the highest F1 without examining error consequences.
- Reporting multiclass results without explaining macro, micro, or weighted averaging.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/precision-and-recall/#visualization-precision-and-recall>)

## Sources

1. [Classification: Accuracy, recall, precision, and related metrics](<https://developers.google.com/machine-learning/crash-course/classification/accuracy-precision-recall>) — Google for Developers · Official documentation
2. [Metrics and scoring: quantifying the quality of predictions](<https://scikit-learn.org/stable/modules/model_evaluation.html>) — scikit-learn · Official documentation

## Related topics

- [Model Evaluation](<https://wiki.soroush.uk/topic/model-evaluation/>)
- [Probability Calibration](<https://wiki.soroush.uk/topic/probability-calibration/>)
- [Algorithmic Fairness](<https://wiki.soroush.uk/topic/algorithmic-fairness/>)
