Phase 1: Prepare
Step 1 Warm-up recall
From M8.L2: which two rules tied on training accuracy?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- choose between rules using validation accuracy (Foundation);
- run the chosen rule on the test cases once (Core);
- compare the test result with the baseline (Core).
Phase 2: Teach
Step 3 A familiar example
A recipe is tried at home several times and adjusted. The final dinner for guests is cooked once, from the recipe as it stands, and judged as it comes out.
Step 4 Clear explanation
The two tied rules are now scored on the six validation cases (2 N, 3 N, 4 Y, 5 Y, 7 Y, 9 Y). The rule at 4 predicts renew for 4, 5, 7 and 9, which are all correct, and leave for 2 and 3, also correct: 6 of 6. The rule at 6 predicts renew for 7 and 9 only, so it misses members 4 and 5, who renewed: 4 of 6, or 66.7%. The baseline of always renew scores 4 of 6 on these cases, also 66.7%.
We choose renew if visits are at least 4. Now, and only now, run it on the six test cases (1 N, 3 N, 4 N, 5 Y, 6 Y, 8 Y). It predicts renew for 4, 5, 6 and 8 and leave for 1 and 3. The member with 4 visits left, so that is one error: 5 of 6, 83.3%. The baseline gets 3 of 6, 50%.
The rule beats the baseline by 33 points, a worthwhile gain, but notice the sample: with six test cases, one case is worth 16.7 points. The 100% on validation was also a small-sample result, and it was higher than the test score because we chose the rule using those cases. The test result is the one to report, with its size.
The test cases are then closed. If the rule is changed after seeing the test, the test is no longer a fresh test.
Step 5 Worked example (4 marks)
A rule scores 4 of 6 on validation and a competitor scores 5 of 6. On the test cases the competitor gets 4 of 6, and the baseline gets 3 of 6. Which is chosen, and what is reported?
- Validation accuracy: 4 ÷ 6 = 66.7% and 5 ÷ 6 = 83.3%; the competitor wins. (1 mark)
- The test is used once for the competitor: 4 of 6 right. (1 mark)
- Test accuracy = 4 ÷ 6 = 66.7%; baseline 3 ÷ 6 = 50%. (1 mark)
- Answer: choose the competitor and report 66.7% on the test against the 50% baseline. (1 mark)
Go deeper: the professor's notes
Choose.
Confirm.
One case 16.7 points.
Results
| Item | Accuracy |
|---|---|
| Rule at 4 validation | 100% |
| Rule at 6 validation | 66.7% |
| Rule at 4 test | 83.3% |
| Baseline test | 50% |
At work: Choose and test
Six validation, six test cases.
- Score the tied rules on validation.
- Run the chosen rule on the test once.
What a careful practitioner decides. Report 83.3 percent against 50, with n = 6.
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. The validation cases are used to:
Selection.
2. The test cases are used:
Use once.
3. 5 of 6 correct on the test is an accuracy of:
5 ÷ 6.
4. With 6 test cases, one case is worth about:
1 ÷ 6.
Phase 4: Close
Step 7 Recap
- Validation chooses; the test confirms once.
- Compare the test score with the baseline.
- With few cases one case moves the score a lot.
Step 8 Exit ticket (ungraded)
A rule gets 9 of 12 on the test. What is its accuracy and what is one case worth?
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Explain in two sentences why the validation score of the chosen rule is higher than its test score here.
In industry: Civil war prediction: complex models, simple baseline
In a reproducibility study of civil war prediction, a field where complex machine learning models were believed to vastly outperform older statistical methods, Kapoor and Narayanan found that the papers claiming a clear advantage failed to reproduce because of data leakage. When the errors were corrected, complex models did not perform substantively better than decades-old logistic regression.
Link to this lesson. Always compare against a simple baseline, and distrust a large gap.
Source: Kapoor and Narayanan (2023), Patterns 4(9):100804; preprint arXiv:2207.07048
Common mistakes
| Mistake | Why it fails |
|---|---|
| Changing the rule after seeing the test | Close the test. |
| Reporting validation as final | Report the test. |
| Ignoring the baseline | Compare to it. |
Limits. Six test cases give a very rough figure; the lab shows a case where the model matches the baseline.