← Lessons

quiz vs the machine

Silver1090

Machine Learning

The Precision Recall Tradeoff

Move the decision threshold and watch the two metrics pull apart.

4 min read · intro · beat Silver to climb

Two different questions

For a positive class, precision asks of the items we flagged, how many were truly positive. Recall asks of the truly positive items, how many did we catch. They answer different questions and they rarely move together.

The threshold knob

Most classifiers output a score between zero and one. You pick a threshold above which you call the example positive.

  • Raise the threshold and you flag fewer items. Those you do flag are more likely correct, so precision rises but recall falls.
  • Lower the threshold and you flag more items. You catch more true positives, so recall rises but precision falls.

Choosing a point

The right balance depends on the cost of mistakes.

  • For a spam filter, a wrong flag hides a real email, so favor precision.
  • For cancer screening, a missed case is deadly, so favor recall.

Key idea

Precision and recall trade off as you slide the decision threshold. Tune the threshold to match the relative cost of false positives versus false negatives in your problem.

Check yourself

Answer to earn rating on the learn ladder.

1. Raising the classification threshold usually does what?

2. For cancer screening, which metric should you usually favor?