Skip to content
Tactiverge

Learning Rooms/○ Level 3 · Innovator/Perception and signals

Machine Learning Fundamentals: The Confusion Matrix

StatQuest with Josh Starmer · Length: see YouTube · captions on YouTube · nothing loads until you press play

By the end you can…

  • Build a confusion matrix (TP, FP, FN, TN) from labelled test results.
  • Compute precision and recall and explain what each protects against.
  • Choose a decision threshold by weighing false positives against false negatives.
?Predict▶Watch✓Practise⚙Build

Watch it all: no segment has been checked by hand for this video yet.

1.Predict before you press play

5 in 100 parts are faulty. A detector says 'good' to every part. What is its accuracy?

Pick one before you press play. A wrong guess is fine: it is what makes the video stick.

2.See the idea first

Play with this diagram for a minute. It gives you something to hang the video on.

Loading the interactive…

Can't use the diagram? Read a description instead

Sixty parts are drawn on a score strip: faulty parts as triangles that tend to score high, good parts as circles that tend to score low, with overlap in the middle. A threshold line splits them into flagged and passed. The table shows TP, FN, FP and TN; at a threshold of 50 on the tuning batch most faulty parts are flagged and a handful of good parts are wrongly flagged.

3.Watch, actively

Builds the four-box table of right and wrong answers that every classifier, from a vision check to a medical test, is judged by.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Watch for…

  • → Watch how each box of the matrix is defined; then notice that this lesson calls 'faulty' the positive class.

Pause whenever you like. Rewatching a hard minute is a good habit, not a failure.

Can't stream it? Read the idea instead

A confusion matrix sorts a classifier's answers into four boxes: true positives, false positives, true negatives and false negatives. Accuracy alone hides which mistakes are made, and the boxes show whether a detector misses faults or raises false alarms.

What the video covers (our own note, written when we verified it): Builds the four-box table of right and wrong answers that every classifier, from a vision check to a medical test, is judged by.

Written by Tactiverge in our own words, not a transcript. The full lesson below explains the idea without the video.

Jot down one thing that surprised you and one question you still have.

Private: saved only on this device, never sent to Tactiverge.

4.Practise what you just saw

These come from the lesson that use this video and are checked on the server. Wrong answers get a hint and another try.

Practice 1 · a fresh version every time

A defect detector is tested on labelled parts: TP = 23, FP = 33, FN = 8, TN = 108. What is its recall, as a percentage?

%

Practice 2 · a fresh version every time

A defect detector is tested on labelled parts: TP = 37, FP = 21, FN = 24, TN = 251. What is its precision, as a percentage?

%

Practice 3

You lower the detection threshold. What usually happens?

Practice 4

For an airport bag scanner, which matters most?

6.Build something with it

Follow-up project

Using the tuning batch, list the confusion matrix at thresholds 40, 50, 60 and 70. Pick one for a line where a missed fault costs ten times as much as a scrapped good part, and justify it with the counts. Then check it on the fresh test batch.

Where this video lives

In the course catalogue: AIP-350 Perception system lab

The video is by StatQuest with Josh Starmer, embedded from YouTube with privacy-enhanced mode and never autoplayed. The room around it (prompts, notes, practice, projects) is Tactiverge's, written with AI assistance and checked by automated tests only.