Classification: which basket?
Uncle sorts a thousand apples without looking up. "Thirty years of apples taught me." Thirty years of examples — that's how AI learns to sort.
- Find the rule hiding in labelled examples
- Sort apples the rule has never seen
- Find out why two pairs disagree
Classification: which basket?
Uncle sorts a thousand apples without looking up. "Thirty years of apples taught me." Thirty years of examples — that's how AI learns to sort.
- Find the rule hiding in labelled examples
- Sort apples the rule has never seen
- Find out why two pairs disagree
Story
without even looking up.
Learn it
Uncle is doing classification: every apple goes into one of three boxes, and the boxes never change. He learned how from thirty years of apples that were already sorted. An AI learns the same way, only faster. We show it examples where the right box is already known, it finds the rule hiding in them, and then it sorts apples it has never seen. That last part is the whole point.
Words to know
putting each item into one group from a fixed list of groups. The answer is always a group, never a number.
one of the groups, such as box A or "spam".
the name of the right group for one item, such as "Grade A".
examples where the label is already known, like the apples Uncle has already packed.
the things we measure to decide, such as an apple's size and how red it is. Good features make sorting easy.
learning a rule from labelled examples.
the rule that training produces. It is what sorts the new items.
Step by step: sorting walnuts
A trader in Kupwara sorts walnuts into Premium and Regular. Here are five she has already labelled:
| Walnut | Weight (g) | Shell | Label |
|---|---|---|---|
| 1 | 14 | light | Premium |
| 2 | 13 | light | Premium |
| 3 | 14 | dark | Regular |
| 4 | 9 | light | Regular |
| 5 | 10 | dark | Regular |
- Pick the features. She looks at two things: weight and shell colour.
- Look at one class. Both Premium walnuts weigh 13 g or more and have a light shell.
- Write the rule. 13 g or more and light shell → Premium. Anything else → Regular. This rule is the model.
- Sort a new walnut. A new one weighs 15 g and has a light shell, so the model says Premium. One that weighs 15 g with a dark shell is Regular.
Now you will do the same with Uncle's apples, with three boxes instead of two.
Careful: classification answers "which group?". If the question is "how much?" or "how many?", like tomorrow's snowfall in centimetres, the answer is a number. That is a different technique, regression, in Lesson 1.2.
Your missions
apple-grades.ods (sheet Training: 20 graded apples · sheet New: 10 ungraded)Study the examples
pairs6 min- 1
Open
apple-grades.ods, sheet Training. Each row is one apple: size (mm) · red (%) · grade. - 2
Click in the table, Data → Sort, sort by Grade. Now the A's, B's and C's sit together.
- 3
In G2, write what every A apple has in common. In G3, the same for C. (Hint: look at the smallest A.)
Write the rule
pairs3 min- 4
Agree a rule like this — your numbers may differ: "size 70+ AND red 70%+ → A. Size under 65 OR red under 50% → C. Otherwise → B." Type it in G5. You've just trained a model in your head.
Sort new apples
pairs7 min- 5
Predict: how many of the 10 new apples will be grade A? Write your guess in G7.
Only you can see this - 6
Open sheet New. Fill the Grade column by hand using your rule.
- 7
Swap laptops with another pair. Where did you disagree, and why?
In D2 type =IF(AND(B2>=70;C2>=70);"A";IF(OR(B2<65;C2<50);"C";"B")) and drag it down to D11.
Does the formula agree with your hand grades?
No laptop today?
The teacher writes 12 apples on the board (size and red %), 8 already graded. Pairs find the rule from the 8, grade the last 4, and compare with the pair next to them.
Debate it
Uncle's rule says small apples go into box C, and C apples sell for much less. But one orchard in a high village always grows smaller apples, however good they taste.
Is the rule fair to that farmer? What feature is the rule missing?
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.In classification, the output is:
- AA number, like 25.3
- BA group or category, like "Grade A"
- CA chart
- DA random guess
2.To train a classification model, we need examples where the correct group is already known.
TrueFalse3.Which of these are classification problems? (choose all)
- AIs this email spam or not spam?
- BHow many centimetres of snow will fall tomorrow?
- CIs this leaf healthy or diseased?
- DWhich grade box (A, B or C) should this apple go into?
4.The things a model looks at, such as the size and colour of an apple, are called ______.
Classification = learning from labelled examples, then putting new things into the right group.
Typing practice
Skill: the number row (7 min)
- On typing.com, open the number row lesson for your level.
- Today's sheet is full of numbers like
72and85, so keep your fingers on the home row and reach up to the numbers. - Then type these five lines in a blank Calc sheet, pressing Enter after each:
72·64·81·58·90 - Goal: 90% accuracy. Your own score, compared only with your own last time.
- 72
- 64
- 81
- 58
- 90
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.