Modelling and evaluation
The sticky note says 94%. Hiba tests it on twenty real leaves. One mistake could cost an orchard its season.
- Write a rule-based model
- Build a 2×2 table from real results
- Say which mistake costs more, and to whom
Modelling and evaluation
The sticky note says 94%. Hiba tests it on twenty real leaves. One mistake could cost an orchard its season.
- Write a rule-based model
- Build a 2×2 table from real results
- Say which mistake costs more, and to whom
Story
reading the total.
Learn it
Stage four is modelling, and a model can be built two ways: a person writes the rules, or the machine learns them from labelled examples. Stage five is evaluation, and it is more than one percentage. Every prediction lands in one of four boxes, and the two kinds of mistake (a false alarm and a miss) almost never cost the same. "94%" on a sticky note hides exactly that.
Words to know
stage four: building the model that makes the predictions.
a person writes the rules (if snowfall > 10 cm and the road is not cleared, predict low attendance). You can read it, argue with it and fix one line.
the machine finds the rule from labelled examples. Nobody wrote it, and nobody can read it back.
stage five: checking the model's predictions against what really happened.
the thing you are looking for, such as a leaf with scab. Decide this first.
/ True Negative (TN) — correct: scab called scab; healthy called healthy.
a false alarm: a healthy leaf called scabbed.
a miss: a scabbed leaf called healthy.
(TP + TN) ÷ total × 100. It treats both mistakes as equal.
Step by step: a 2×2 table for a fever checker
Positive = the child has a fever. Twenty children are checked:
| Checker said fever | Checker said no fever | |
|---|---|---|
| Actually fever | TP = 4 | FN = 1 |
| Actually no fever | FP = 3 | TN = 12 |
- Fill the boxes by comparing each prediction with reality.
- Accuracy = (4 + 12) ÷ 20 × 100 = 80%.
- Read the mistakes, not just the total: 3 false alarms (a child sent to the nurse for nothing) and 1 miss (a sick child sent back to class).
- Decide which matters more: here the miss does. A different checker with fewer misses and more false alarms may be the better one, even at the same accuracy.
Rule-based is not a lesser choice. If you can write the rule, write it: it is cheap, explainable and needs no training data. Use a learned model when the rule is too hard to write down.
🕌 From our heritage
Ibn Sīnā (980–1037) set out rules for testing whether a remedy really works, in the Canon of Medicine. One of them says that the trial must be repeated: if the effect appears only once, it may have been an accident, not the remedy at all. He also warned that a drug tested on a single complicated case tells you nothing, because you cannot say what caused what. Twenty leaves, honestly recorded, is that rule applied to a model — and the sticky note saying 94% is the single lucky trial he was warning about.
Source: Ibn Sīnā, al-Qānūn fī al-Ṭibb (c. 1025), Book II, on testing the effects of remedies.
Careful: a false positive does not mean the model is lying. It flagged something that turned out fine, and for a screening tool that is sometimes exactly what you want. And labelling the four boxes depends on which class you call positive: decide that first and write it at the top.
Your missions
leaf-results.ods (sheets Rules, Results, Matrix)A rule-based model
8 minin pairs- 1
Sheet Rules: write a rule-based model for winter attendance as three or four
if … then …lines. - 2
Beside it: what data does your rule need? What would a learning-based model need instead?
- 3
Mark the line everyone would argue about. A learning-based model would have decided it for you, silently.
The 2×2 table
12 min- 4
Sheet Results: twenty leaves — what the model said, what each really was.
- 5
In a cell, write what positive means: the leaf has scab.
- 6
Predict: which box will be biggest? Which smallest?
Only you can see this - 7
Sheet Matrix: fill the four counts with
COUNTIFS. Actual down the side, model said across the top:Model said scab Model said healthy Actually scab True Positive False Negative Actually healthy False Positive True Negative - 8
Accuracy:
=(TP+TN)/20*100. Then answer below the grid: which box would you shrink first — and what does the grower do after each kind of mistake?
Two models both score 85%. One makes only false positives, the other only false negatives. Which would you give the grower?
No laptop today?
Draw the grid on the board. Your teacher reads the twenty results; everyone tallies in their notebook, then works out the counts and accuracy by hand.
Debate it
A hospital screening model is meant to catch a disease early.
- Would you rather it made false positives or false negatives? What happens to the patient in each case?
- The disease affects one person in a hundred. Describe a useless model that is "99% accurate".
- Who should decide the balance between the two mistakes — the engineer, the doctor, or the patient?
Check yourself · practice, not a test
In the app, students answer these one at a time and each answer is checked straight away. It's practice, never a mark — anything they miss comes back later for another go.
1.Match each result to its name. Positive = the leaf has scab.
- Scabbed leaf, model said scabbed
- Healthy leaf, model said scabbed
- Scabbed leaf, model said healthy
- Healthy leaf, model said healthy
- False Positive
- False Negative
- True Negative
- True Positive
2.An orchard model misses scab on infected trees. Which box is filling up?
- ATrue Positive
- BFalse Positive
- CFalse Negative
- DTrue Negative
3.Two models with the same accuracy are equally good.
TrueFalse4.A model whose rules are written by a person, not learned from data, is called ______-based.
5.When is a rule-based model the better choice? (choose all that apply)
- AWhen a person can state the rule clearly
- BWhen there is no training data
- CWhen someone must be able to read and argue with the logic
- DWhen the problem involves recognising faces in photographs
Accuracy hides which mistake you are making. The four boxes show it.
Typing practice
Skill: the colon and the comparison operators (5 min)
-
typing.com symbols lessons, focusing on
:,>,<and=. -
Type this three times. It is the rule-based model you will write out in Part 1, in the form Unit 5 will use:
if snowfall_cm > 10: -
Term 1 goal: 32–38 WPM at 94% accuracy.
- :
- >
- <
- =
- if snowfall_cm > 10:
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.