Class 10 · Unit 3: Evaluating models · Lesson 3.1 · 40 min
Why evaluate, and the train-test split
The leaf app scored 99% at the exhibition. In the orchard it was wrong again and again. Both were true.
Today you will: Split data into training and testing · Catch a model that memorised · Say why a test must use unseen data
Story
Last year's science exhibition had one star: a laptop app that looked at a photo of an apple leaf and said healthy or scab. The sign beside it said 99% accurate, and it was true.
In spring, Hiba's uncle tried it on his own trees. It called a scabbed leaf healthy. Then another. Then it called a healthy one scab.
Uncle: “The sign said ninety-nine.”
Hiba finds the team's notes. They took 200 photos, trained the app on them, and then tested it — on the same 200 photos.
Rahat: “So it wasn't lying.”
Hiba: “No. It was answering questions it had already seen the answers to.”
Watch
The report card for a model — — scan code 10.3.1 in the printed book.
Learn it
The exhibition app really did score 99%, on the same 200 photos it had learned from. That measured its memory, not its skill. Model evaluation is a model's report card, and the only honest score comes from data it has never seen. So before training, the labelled data is split: a training set to learn from, and a testing set locked away until the end.
Words to know
- Model evaluation using measurements to understand how well a model works. CBSE calls it the model's report card.
- Evaluation metric one such measurement, like accuracy.
- Train-test split dividing labelled data into a training set (to learn from) and a testing set (to check with).
- Unseen data examples the model never saw while learning. Only its score on these estimates real-world performance.
- Overfitting a model that remembers its training data instead of learning the pattern. It scores brilliantly on training data and badly on new data.
Step by step: the student who memorised
A teacher gives 20 practice questions. Two students prepare:
| Practice score (training) | New exam questions (testing) | |
|---|---|---|
| Sana learned the method | 18 / 20 | 17 / 20 |
| Umer memorised the answers | 20 / 20 | 6 / 20 |
- Look only at practice: Umer looks better, 20 against 18.
- Test on new questions: Umer collapses to 6. He remembered answers; he never learned the method.
- That is overfitting: perfect on what it has seen, poor on what it hasn't.
- Models do the same. Test on training data and a memorising model looks perfect. Only the testing set shows which one learned.
- Report the test score, even though it is lower. It is the honest one.
Why evaluate at all: to choose between models, to know how far to trust one, and to find problems before deployment rather than after.
Careful: a high training score is not good news on its own; it may only be memory. Always ask: tested on what? If the answer is "the same data it learned from", the score means nothing.
On the laptop
You need: LibreOffice Calc · datasets/apples.csv (with the Training and Testing sheets you made in Lesson 2.1)
Mission 1: A model that learned (10 min, in pairs)
- ☐1
Open your
applesfile with its two sheets: Training (A01–A28) and Testing (A29–A36). Unhidevarietyin Testing. - ☐2
In both sheets, put your best rule from Lesson 2.2 in column G, and score it with
=IF(G2=F2;1;0)in column H. - ☐3
Predict: will the rule score better on Training or on Testing? Write it in J1.
- ☐4
Add up both. Write each score as right out of how many.
Mission 2: A model that memorised (10 min)
- ☐5
Now build a cheat. In Training, column I:
=VLOOKUP(B2;$Training.$B$2:$F$29;5;0). It finds a training apple with exactly the same weight, and copies its variety. Fill down and score it. It does very well. Why? - ☐6
Put the same formula in Testing, column I. Fill down. What happens?
- ☐7
Fill in the table in J5:
Training score Testing score The model that learned The model that memorised
Mission 3: The sign at the exhibition (3 min)
- ☐8
In J10, rewrite the exhibition sign so that it is honest. Keep it under 15 words.
Finished early?
Move 4 apples from Training to Testing and score both models again. Does a bigger testing set change your trust in the scores?
No laptop today?
Your teacher writes 10 apples on the board and hides 3 of them. The class writes a rule using the 7, then tests it on the hidden 3. Then one student "memorises" the 7 aloud and tries to answer the hidden 3 from memory — and can't.
Debate it
The exhibition team were not cheating on purpose. They were proud of a real number.
- Who should have asked "tested on what?" — the team, the judges, or the visitors?
- Hiba's uncle used the app on his own trees. What harm could a wrong healthy have done?
Check yourself — practice, not a test
1. Why is the testing set kept away from the model during training?
- ○ It is too small to learn from
- ○ So its score shows how the model does on data it has never seen
- ○ Testing data has no labels at all
- ○ Models can only read one set at a time
2. A model that scores 100% on its own training data is certain to work well on new data.
- ○ True
- ○ False
3. When a model remembers its training data instead of learning a pattern, it is called ______.
4. Put the train-test procedure in order:
- 1. Split the labelled data into training and testing sets
- 2. Compare its predictions with the true labels
- 3. Train the model on the training set
- 4. Ask the model to predict the testing set
5. CBSE compares model evaluation to:
- ○ A driving licence
- ○ A report card
- ○ A recipe
- ○ A map
Remember
Believe the score on data the model has never seen.
Typing practice
Skill: a lookup formula (5 min)
-
On typing.com: the symbols lessons.
-
Type three times, eyes on the screen:
=VLOOKUP(B2;$Training.$B$2:$F$29;5;0) -
A dollar sign fixes a reference so it doesn't move when you fill down. Goal this term: 38–44 WPM at 95%.