rAs Kids All courses
AI: Build & Break It · Module 6 of 8
📱 Shared phone

The Confusion Matrix

One accuracy number hides everything that matters — you need to know which mistakes it makes.

┌──┬──┐ │ 8│ 2│ │ 3│ 7│ └──┴──┘
A hand-drawn two-by-two grid of tallies: correct answers on the diagonal, mistakes off it.

🎒 What you need

✋ Do this

  1. Draw a 2x2 grid. Rows are the truth, columns are the prediction. Label them clearly before you start.
  2. Test 20 items and put a tally mark in the correct cell each time. No skipping the embarrassing ones.
  3. Count the diagonal — those are your correct answers. Divide by 20 for accuracy.
  4. Now look at the two off-diagonal cells. One is a false alarm (healthy called diseased); the other is a miss (diseased called healthy). Write which is which.
  5. Ask the question that matters: which mistake is worse HERE? A false alarm wastes a farmer's spray. A miss lets disease spread through the field. Decide, and justify it in one sentence.
  6. Now imagine a lazy model that says 'healthy' every time on a pile where only 1 in 10 is diseased. Work out its accuracy. It scores 90% and is completely useless — that is why accuracy alone is a trap.

💡 Why it works

The confusion matrix separates two errors that a single accuracy figure blends together, and they almost never cost the same. In medical screening a miss is far worse than a false alarm; in a spam filter it is the reverse. Precision and recall are just two ways of reading this grid, and choosing which one to optimise is a decision about consequences, not about maths.

🔥 Challenge

Deliberately shift your model to make almost no misses, and observe the false alarms shoot up. Draw both matrices side by side and explain the trade to someone who has never heard of it.

📖 New words

false positivethe model says yes when the truth is no
false negativethe model says no when the truth is yes
recallof all the real cases, the fraction the model actually caught
🔢
Matrix Reader

Tap when you have finished this module.