Training and testing: keep some back
Rahat memorised last year's paper: 100% at home. New questions in the real exam: 41%. Machines make the very same mistake.
- Split data into train, validate and test
- Train a real leaf model in Teachable Machine
- Score it only on photos it has never seen
Training and testing: keep some back
Rahat memorised last year's paper: 100% at home. New questions in the real exam: 41%. Machines make the very same mistake.
- Split data into train, validate and test
- Train a real leaf model in Teachable Machine
- Score it only on photos it has never seen
Story
Learn it
Rahat scored 100% at home and 41% in the exam, because he had learned that paper, not maths. A machine can make the same mistake: it can memorise its examples instead of learning the pattern. So AI builders split their data into three parts and keep one part hidden until the very end. Only a score on data the model has never seen tells you how it will do in the real world.
Words to know
a collection of data used to teach and check a model.
(or record) — one item in a dataset, such as one photo or one row, with its features.
the part the model learns from, like studying your notes.
the part used to check and improve the model while it trains, like practice sums.
the part kept back for the final check, on data the model has never seen, like the real exam.
doing well on the examples you studied but badly on new ones. It looks like learning, but it isn't.
the share of test items the model gets right, written as a percentage.
Kinds of datasets
| Type | What it holds | Kashmiri example |
|---|---|---|
| Numerical | numbers | daily milk from a dairy |
| Text | words | messages in a class group |
| Multimedia | images, audio, video | photos of chinar and willow leaves |
| Time-series | readings over time | Srinagar's temperature every month for 30 years |
| Spatial | places and locations | GPS points of every school in Baramulla district |
By shape: structured data fits neat rows and columns (a marks table); unstructured data does not (photos, voice notes); hybrid data mixes both (a shop's sales table plus photos of each product).
Step by step: a 60 / 20 / 20 split
You have 50 photos of walnut leaves.
- Training, 60%: 60% of 50 = 30 photos. The model learns from these.
- Validation, 20%: 10 photos. Check while training; if it gets many wrong, add examples or train longer.
- Test, 20%: 10 photos, locked away until the end.
- The final exam: show the model the 10 test photos once. 9 right out of 10 = 90% test accuracy.
Careful: validation and test are not the same thing. Validation is the practice sums: you can look at the result, change the model and try again. The test is the final exam, used once, at the end. And 100% on the training data does not mean the model is perfect; it may only have memorised.
Your missions
leaves/chinar/ and leaves/willow/ (30 photos each, already split: train 18 · validation 6 · test 6) · leaf-test.odsTrain
pairs6 min- 1
Teachable Machine → Get Started → Image Project → Standard image model. Rename the classes
ChinarandWillow. - 2
Upload the 18
trainphotos into each class. Click Train Model — don't switch tabs.
Check and improve
pairs5 min- 3
In Preview, switch Webcam to File. Try the 12
validationphotos. How many right? - 4
If several are wrong, add training photos or raise Epochs (under Advanced), and train again.
The final exam
pairs6 min- 5
Predict: what score will it get on photos it has never seen? Write it at the top of
leaf-test.ods.Only you can see this - 6
Try the 12
testphotos once each. Type the model's answer andYesorNofor right. - 7
Score:
=COUNTIF(C2:C13;"Yes")/12, as a percentage. That's your test accuracy. 🔒 Teachable Machine trains inside your browser. Don't click Export Model or save to Drive.
No laptop today?
The quiz-master game. Write 15 "What am I?" cards about leaves or fruit. Show a volunteer 9 cards (training), then 3 with feedback (validation), then 3 they've never seen (test). Which did they do best on? Why does that matter?
Debate it
A company says its apple-disease model is "99% accurate!" but it tested the model on the same photos it trained on.
Should an orchard farmer trust that number? What question would you ask the company?
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.Put the three parts of a dataset in the order they are used:
- 1Validation dataset
- 2Test dataset
- 3Training dataset
2.Which part of the dataset is used for the final check of the model?
- ATraining
- BValidation
- CTest
- DAll of them together
3.The model should see the test photos many times while it is training.
TrueFalse4.Match each dataset to its type:
- Srinagar's temperature every month for 30 years
- Photos of chinar and willow leaves
- GPS locations of all the schools in Baramulla district
- Multimedia dataset
- Spatial dataset
- Time-series dataset
5.You have 100 images. With a 60/20/20 split, ______ images are used for training.
Train on some, check on some, test on data the model has never seen.
Typing practice
Skill: numbers and the % sign (7 min)
- On typing.com, practise the number row and symbols.
- Type these into Calc:
60%·20%·20%·=18/30·=6/30(The%sign is Shift + 5.)
- 60%
- 20%
- 20%
- =18/30
- =6/30
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.