Class 7 · Unit 1: Three techniques · Lesson 1.1 · 40 min
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.
Today you will: Find the rule hiding in labelled examples · Sort apples the rule has never seen · Find out why two pairs disagree
Story
It is October, and Bilal's uncle is packing apples at the Sopore fruit mandi. Three wooden boxes stand in a row, marked A, B and C.
Hiba: “How do you know which box?”
Uncle: “Big and red goes in A. Small or pale goes in C. The rest go in B. Thirty years of apples taught me.” (without even looking up.)
Bilal: “Thirty years of examples. That's exactly how an AI learns to sort.”
Can we learn Uncle's rule from his boxes, and then sort apples he has never seen?
Watch
Classification, sorting into baskets — scan code 7.1.1 in the printed book.
Warm up your fingers
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.
On the laptop
You need: LibreOffice Calc · apple-grades.ods (sheet Training: 20 graded apples · sheet New: 10 ungraded)
Mission 1: Study the examples (pairs, 6 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.)
Mission 2: Write the rule (pairs, 3 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.
Mission 3: Sort new apples (pairs, 7 min)
- ☐5
Predict: how many of the 10 new apples will be grade A? Write your guess in G7.
- ☐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?
Finished early?
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.
Now you know
- Classification puts each item into one of a fixed set of groups — A/B/C, spam/not spam, healthy/sick.
- Labelled data teaches it: examples where the right answer (the label) is known. Learning from them is training.
- Features are what it looks at — size, colour. Good features make sorting easy.
- New, unseen items are the point: after training, it sorts things it has never met.
- The answer is a group never a number.
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
1. In classification, the output is:
- ○ A number, like 25.3
- ○ A group or category, like "Grade A"
- ○ A chart
- ○ A random guess
2. To train a classification model, we need examples where the correct group is already known.
- ○ True
- ○ False
3. Which of these are classification problems? (choose all)
- ○ Is this email spam or not spam?
- ○ How many centimetres of snow will fall tomorrow?
- ○ Is this leaf healthy or diseased?
- ○ Which 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 ______.
Remember
Classification = learning from labelled examples, then putting new things into the right group.