TOPIC 14/5118 MINNOT STARTED

Precision, recall, drift and the right metric for a model

Count a model's two kinds of mistake in a confusion matrix, pick precision or recall to fit the cost of each, and watch for drift after release.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a smoke alarm. A smoke alarm can fail in two ways. If it is too sensitive, it shrieks over toast. If it is too dull, it misses the fire. Changing sensitivity often trades one error against the other, but this is not an impossibility rule: a perfectly separated test set can have neither false alarms nor misses.

Daily List is a to-do list app. Leo's urgent helper is an alarm for urgent tasks. It can flag a task that is not urgent. That is a false alarm. It can miss a task that is urgent. That is a missed fire. Tom wants to count both.

He uses a , a small table that counts the helper's right and wrong answers for each kind of answer. From it he works out : two numbers. Precision asks: of the tasks flagged, how many were truly urgent? Recall asks: of the truly urgent tasks, how many were caught?

After release the world can change. Users start to use Daily List differently. The helper meets tasks unlike the ones it learned from. That change is . A helper that was good in week one may be poor in week nine, with no change to its code.

The picture has limits. A smoke alarm has one dial, and a model can have many. A fire is clearly a fire, but whether a task is urgent can depend on who you ask.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Counting a model's two kinds of mistake, then choosing which one to guard against.

  1. Count both mistakes
  2. Read the table
  3. Pick by cost
  4. Watch for change
Toast or fire

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A loud alarm over toastA false alarm
Missing a real fireA missed case
The dial on the alarmThe cut-off
A change in how people cookData drift

WHERE THIS PICTURE STOPS

  • A smoke alarm has one dial. A model can have many.
  • A fire is clearly a fire. Urgent depends on who you ask.
  • Cooking habits change slowly. Data can change fast.

HOOK

Toast or fire.

REMEMBER IT THIS WAY

A contrast: two neighbours told apart by one test.

Precision asks: of the tasks flagged, how many were right? Recall asks: of the urgent tasks, how many did the helper find?

What each part of the trick stands for
In the trickWhat it stands for
Precisionof the tasks flagged, how many were right
Recallof the urgent tasks, how many were found

TELL A FRIEND

A smoke alarm can shriek over toast or miss a real fire. You count both and choose which to guard against.

OFTEN MIXED UP WITH Testing AI and machine-learning features. The overview lesson asks how to judge a learned feature at all. This lesson gives the numbers to judge it with.

PRACTISE AND KEEP

Sources for this topic — 5 sources
  1. Market practice

    Classification: accuracy, recall, precision and related metrics (Google Machine Learning Crash Course) ↗ — Google · Accuracy is a rough measure only when classes have similar counts; with rare positives a model that always predicts the common class scores high yet is useless; recall and precision are more meaningful, and all are computed at one fixed threshold (search excerpt, page not opened)

    Course page. Says the best metric depends on the task and on the cost of each kind of mistake. Search excerpt only. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Metrics and scoring: quantifying the quality of predictions (scikit-learn user guide) ↗ — scikit-learn project · The confusion matrix counts items by true group and predicted group; precision is true positives over true positives plus false positives (search excerpt, page not opened)

    Lists the classification metrics, including the confusion matrix (entry i, j counts items truly in group i and predicted in group j), precision as true positives over true positives plus false positives, and recall. Documentation for one library. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: scikit-learn 1.9.1 documentation as seen in the excerpt. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    What Is Data Drift in Machine Learning (and How to Detect It) (Chalk blog) ↗ — Chalk · Data drift is a change in the distribution of input features in production compared with training while the model itself stays the same (search excerpt, page not opened)

    Describes data drift as a change in the distribution of the input features in production compared with training, while the model itself stays the same, and separates it from concept drift. Vendor blog. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    Artificial Intelligence Risk Management Framework, version 1.0 (National Institute of Standards and Technology) ↗ — National Institute of Standards and Technology · Test sets and metrics are documented, and systems are tested before release and while running (search excerpt, page not opened)

    Framework. Has four functions called govern, map, measure and manage, and lists traits of trustworthy AI such as valid, safe, explainable and privacy-enhanced. Search excerpt only. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  5. Market practice

    scikit-learn 1.9.1 — Validation curves and learning curves ↗ — scikit-learn developers · Actual scikit-learn 1.9.1 user guide §3.5.1 body read 6 November 2026: validation-based selection biases that score as a generalisation estimate; independent evaluation is needed after selection. Applied here to decision-rule selection, not a mandated business threshold.

    Actual complete substantive user-guide body read: §3.5.1 separates hyperparameter selection from independent generalisation evaluation; §3.5.2 defines a learning curve over varying training-sample counts. Training-progress curves used elsewhere require a stated axis. · Checked 2026-11-06

    Returned exact title/URL and version1.9.1 verified. This review does not claim opening linked API pages or visually reviewing/reproducing the embedded figures.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.