Phase 1: Prepare
Step 1 Warm-up recall
From M2.L2: which measure counts large errors more, MAE or RMSE?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- compute accuracy by hand (Foundation);
- find the majority baseline (Core);
- explain how class balance can mislead (Core).
Phase 2: Teach
Step 3 A familiar example
A clinic screens for a rare condition that one patient in a hundred has. A nurse who tells every patient “you are fine” is right 99 times in 100, yet finds nobody who is ill.
Step 4 Clear explanation
When a model predicts a category, such as renewed or not, error is not a gap but a right or wrong answer. Accuracy is the share of predictions that are right: correct predictions ÷ all predictions.
| Predicts | Right on | Accuracy |
|---|---|---|
| Always “renews” (majority baseline) | 16 of 20 | 80% |
| A model | 17 of 20 | 85% |
Suppose 16 of 20 customers renewed. A rule that always predicts “renews”, called the majority baseline, is right on 16 of 20, an accuracy of 80%, without learning anything. A model that gets 17 of 20 right has an accuracy of 85%, which is only five points above the baseline.
So an accuracy figure means little until the class balance is known. When one class is rare, a model that never finds it can still look excellent. The clinic example is the extreme case, where accuracy of 99% hides a complete failure to find the patients who matter. Module 6 returns to this with precision and recall, which look at the rare class directly.
Step 5 Worked example (4 marks)
Out of 50 emails, 45 are genuine and 5 are spam. A filter marks every email as genuine. Find its accuracy and say what it shows.
- It is right on the 45 genuine emails and wrong on the 5 spam. (1 mark)
- Accuracy = 45 ÷ 50 = 90%. (1 mark)
- It catches no spam at all. (1 mark)
- Answer: 90%, which looks good but finds none of the spam. (1 mark)
Go deeper: the professor's notes
Share right.
Always the commonest.
May be missed.
Rare class
| Model | Accuracy | Finds the rare cases? |
|---|---|---|
| always “fine” | 99% | no |
| a screen | 97% | yes |
At work: A screening test
One patient in a hundred is ill.
- Compute the majority baseline.
- Look at the rare class directly.
What a careful practitioner decides. Never quote accuracy without the baseline.
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. Accuracy is:
Share correct.
2. The majority baseline always predicts:
The commonest class.
3. 95 of 100 cases are class A. Always predicting A gives an accuracy of:
Right on all of A.
4. High accuracy with a rare class may hide:
The rare class can be missed entirely.
Phase 4: Close
Step 7 Recap
- Accuracy is the share of right predictions.
- The majority baseline sets the level to beat.
- Class balance decides how much accuracy means.
Step 8 Exit ticket (ungraded)
30 of 40 loans were repaid. What accuracy does always predicting “repaid” give?
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Find a real screening or fraud example where the rare class is what matters.
In industry: Zillow Offers: price forecast error with money attached
In November 2021 Zillow decided to wind down its home-buying business after taking a $304 million inventory write-down in the third quarter on homes bought at higher prices than it expected to sell them for. The chief executive said the company had been unable to forecast home prices three to six months out accurately enough.
Link to this lesson. Error in a forecast becomes a cost when decisions are made on it, and larger errors at longer horizons matter most.
Source: NPR, 3 November 2021; CNN reporting via KRDO, 9 November 2021
Common mistakes
| Mistake | Why it fails |
|---|---|
| Quoting accuracy alone | Always give the baseline beside it. |
| Ignoring a rare class | It may be the one that matters. |
| Treating 99 percent as always excellent | Compare with always predicting the majority. |
Limits. This lesson covers two classes only; more classes use the same idea.