Precision and Recall

Precision and recall describe different failure costs for positive predictions.

For binary decisions:

Precision asks whether predicted positives are trustworthy. Recall asks whether true positives are recovered.

Thresholded Decisions

If a model produces a score , a threshold creates a decision:

Changing changes precision and recall:

The threshold should be selected on validation data, not on the final test set.

Retrieval and Detection

Precision and recall also apply beyond classification:

  • Retrieval: precision asks how many returned items are relevant; recall asks how many relevant items were found.
  • Object detection: precision and recall depend on class, confidence threshold, and IoU matching.
  • Virtual screening: early precision or enrichment may matter more than global recall.

Prevalence Boundary

Precision depends on class prevalence:

where is prevalence. The same classifier can have very different precision when deployment prevalence differs from the benchmark.

Recall does not depend on the number of true negatives, but it depends on what was labeled as positive and whether positives are complete.

F Score

The score combines precision and recall:

emphasizes recall, while emphasizes precision. Report and the threshold-selection rule.

Averaging

For multi-class or multi-label tasks:

AveragingMeaning
micropool TP/FP/FN globally
macroaverage class-level metrics equally
weightedaverage class-level metrics by support
per-classreport each label separately

Macro metrics reveal rare-class failures. Micro metrics can hide them.

Checks

  • What counts as a positive?
  • Are false positives or false negatives more costly?
  • Is the threshold fixed before final evaluation?
  • Is prevalence similar between validation, test, and deployment?
  • Is precision/recall reported per class, macro-averaged, or micro-averaged?
  • Are labels complete enough that missing positives are not counted as false positives?