datarekha
Machine Learning Medium Asked at GoogleAsked at AmazonAsked at MetaAsked at NetflixAsked at Stripe

When should you optimize precision and when should you optimize recall?

The short answer

Optimize precision when a false positive is costly — spam filters, ad targeting, legal evidence — because you'd rather miss some positives than act on wrong ones. Optimize recall when a false negative is costly — cancer screening, fraud detection, safety systems — because missing a true positive can be catastrophic. The business cost of each error type should drive the choice, not the metric itself.

How to think about it

Lead with the asymmetry of costs, then anchor each direction with a concrete domain. Interviewers want to hear you reason about consequences, not recite formulas.

The definitions

  • Precision = TP / (TP + FP) — of every positive prediction you made, what fraction was actually positive?
  • Recall = TP / (TP + FN) — of every actual positive, what fraction did you catch?

Raising the decision threshold boosts precision (you only fire when confident) but lowers recall (you miss borderline true positives). Lowering the threshold does the opposite.

When precision is the priority

Spam filtering. If your model marks a legitimate email as spam (FP), the user misses an important message. A missed spam (FN) is annoying but harmless. You’d rather let some spam through than block real mail — so optimise precision, tolerate lower recall.

Judicial evidence flagging. Falsely accusing an innocent person (FP) has enormous legal and ethical cost. Missing a guilty party (FN) is investigated by other means. Precision first.

Ad targeting. Showing an irrelevant ad wastes budget (FP). Missing a potential buyer (FN) just means one fewer conversion. Each impression costs money, so you want your positives to be accurate.

When recall is the priority

Cancer screening. Missing a tumour (FN) can cost a life; an additional biopsy on a false positive is inconvenient but manageable. Catch every possible case — recall first.

Fraud detection. A missed transaction fraud (FN) means money lost; a wrongly flagged transaction (FP) triggers a customer service call. Most fraud teams accept higher FP rates to keep recall above 90%.

Safety-critical alerts. A fire suppression system that fails to trigger (FN) is catastrophic; a false alarm (FP) is a drill. Recall dominates.

Balancing both: F1 and F-beta

When neither extreme is acceptable, F1 (harmonic mean of precision and recall) provides a single number. When one matters more, use F-beta: (1 + beta²) * P * R / (beta² * P + R). Set beta > 1 to weight recall higher (e.g., beta = 2 for fraud), beta < 1 to weight precision higher (e.g., beta = 0.5 for spam).

Learn it properly Metrics that matter

Keep practising

All Machine Learning questions

Explore further

Skip to content