Start studying
Module 1 · Machine Learning Module contents
Module 1  ·  Card 44 / 55beginner

Precision

Precision asks: of everything the model flagged as positive, how much really was?

It is true positives divided by all predicted positives.

High precision means few false alarms.

It is the metric you care about when a false positive is expensive.

Flagging a legitimate email as spam is exactly that kind of costly mistake.

Learn in depth ↓
Module 01 · Machine Learning · 55 concepts
In depth  /  15 lines

Precision, in more detail

Precision answers one question: when the model raises its hand, how often is it right?

It counts only the cases the model flagged.

Everything it stayed quiet about is ignored completely.

So it measures the cost of false alarms and nothing else.

It is the metric you want when acting on a flag is expensive.

Blocking a real customer's card, or deleting a genuine email, is that kind of cost.

You can push precision very high by only flagging the obvious cases.

The model then misses almost everything, and precision still looks great.

That is why precision on its own is never enough.

It has to be read next to recall, always.

Raising the threshold lifts precision and lowers recall, every time.

The right point on that trade-off is a business decision, not a technical one.

Ask what happens to the person on the receiving end of a false alarm.

If the answer is mild, favour recall, and if it is serious, favour precision.

Precision measured at a fixed recall is often the honest way to report it.

Want the full technical article? Wikipedia ↗
Deep dive

What is underneath Precision

The formula

Precision=TPTP+FP\mathrm{Precision} = \frac{TP}{TP + FP}

The denominator is everything the model called positive, so precision asks: when it raised a flag, how often was it right?

  • TPTP: flagged and correct.
  • FPFP: flagged and wrong. A false alarm.

Note what is missing: FNFN does not appear. Precision knows nothing about what the model missed.

What it costs to get it wrong

Precision is the metric that matters when acting on a false positive is expensive.

A spam filter with low precision deletes real mail. A fraud system with low precision freezes honest customers' cards.

In both, the cost lands on someone who did nothing wrong, which is why these systems are tuned for precision even at the price of missing cases.

Trivially maximised, which is the catch

Precision=11+0=1.0\mathrm{Precision} = \frac{1}{1 + 0} = 1.0

Make exactly one prediction, the one you are surest of, and get it right. Precision is now perfect.

This is why precision is never quoted alone: it can be driven to 1 by refusing to predict, and the thing you gave up to get there is recall.

The threshold moves it

  1. A classifier outputs a score, not a decision.
  2. A threshold turns that score into a yes or a no.
  3. Raise the threshold and fewer things are flagged.
  4. Those that survive are the confident ones, so precision rises.
  5. And the ones now below the line become misses, so recall falls.

Precision and recall are two readings of the same dial. Quoting one without the other, and without the threshold, is not a measurement.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
Why is F1 the harmonic mean of precision and recall rather than the plain average?
Machine Learning

55 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close