Module 5 · Lesson 3 of 623/56 in the course~22 min
Module lessons (3/6)
Confusion matrix and metrics
Lesson preview6 hands-on exercises readyMachine Learning: from first principles to practice · Module 5 — Classification
Accuracy, precision, recall, F1 and the threshold trade-off.
What you'll learn in this lesson
- Read a confusion matrix and name its four cells.
- Compute accuracy, precision, recall and F1.
- Explain how moving the threshold trades precision against recall.
Overview
A medical test can be wrong in two ways: it can raise a false alarm (healthy person flagged) or miss a real case (sick person cleared). They have very different costs. Accuracy lumps them together and hides the difference. The confusion matrix keeps them apart.
From these four counts we derive complementary metrics tailored to different mistake costs:
Sections covered in this lesson
- 1The hook: not all mistakes are equal
- 2Try it: threshold lab
- 3Progressive examples: metrics from counts and probabilities
- 4Practice
- 5Check your understanding
Pro Lesson · Module 5 — Classification
Unlock "Confusion matrix and metrics" and the full Machine Learning: from first principles to practice curriculum
Accuracy, precision, recall, F1 and the threshold trade-off.
Unlock all 6 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.