Class 7 · Unit 1: Three techniques · Lesson 1.3 · 40 min
Clustering: finding groups nobody labelled
A crate of mixed apples, labels lost. Nobody knows which is which. Hiba finds three groups anyway — and so can a machine.
Today you will: Spot groups in data with no labels · Colour the clusters on a chart · Name what each group means
Story
A new fruit shop opens near Lal Chowk. The owner, Mir Sahib, buys a big crate of mixed apples from three different orchards, but the labels have fallen off.
—: “I don't know which apple came from where. But my customers want sweet ones for eating and sour ones for cooking.” (he sighs.)
Hiba weighs a few apples and tastes some slices. "Look, the heavy ones are all quite sweet, and these little ones are really sweet. And these medium ones are sour!"
Nobody told Hiba the groups. She found them herself. Can a machine do that too?
Watch
Clustering, groups without labels — scan code 7.1.3 in the printed book.
Learn it
Hiba found three groups of apples without anyone telling her what the groups were. She looked at features (weight, sweetness), put similar apples together, and then decided what each group meant. A machine can do the same. Grouping similar items with no labels is called clustering, and it is useful exactly when nobody knows the groups yet.
Words to know
- Clustering grouping items that are similar, with no labels given in advance. The machine discovers the groups itself.
- Cluster one of the groups it finds: a "cloud" of points close together on a chart.
- Similar close together in their features. Two apples of 150 g and 152 g are similar in weight.
- Unlabelled data data with no right answers attached, like a crate of apples with the labels lost.
- Naming the human part: looking at each cluster and deciding what it means.
Step by step: clustering the weather
Six days, each with two features:
| Day | Temperature (°C) | Rain (mm) |
|---|---|---|
| A | 30 | 0 |
| B | 29 | 1 |
| C | 2 | 0 |
| D | 0 | 1 |
| E | 15 | 25 |
| F | 14 | 30 |
- Compare the features: A and B are both hot and dry, so they are close together.
- Group what is close: {A, B}, {C, D}, {E, F}. That makes three clusters.
- Check the gaps: each group is far from the others, so the clusters are clear.
- Name them (the human part): hot days, cold days, rainy days.
On a scatter chart, the same thing appears as three separate clouds of points.
Classification or clustering? Classification starts with labels (Uncle's packed boxes). Clustering starts without them, and finds the groups first.
Careful: the machine finds groups, but it does not know what they mean. Two people may draw the line between clusters in slightly different places, or name them differently, so a person must always check that the groups make sense.
On the laptop
You need: LibreOffice Calc · fruit-cards-40.ods (40 apples: weight and sweetness, no labels)
Mission 1: See the clumps (pairs, 5 min)
- ☐1
Open
fruit-cards-40.ods. 40 rows — nothing tells you the group. - ☐2
Predict: how many groups are hiding in here? Write your guess in F1.
- ☐3
Select B1:C41, Insert → Chart… → XY (Scatter) → Points only → Finish. Count the clumps.
Mission 2: Mark them (pairs, 7 min)
- ☐4
Add a heading
Clusterin D1. Sort by Weight (Data → Sort) and find where the weight suddenly jumps. - ☐5
Give each apple a cluster number — 1, 2 or 3. Use the chart for the tricky ones.
- ☐6
Colour each cluster: select its rows, Format → Cells → Background.
Mission 3: Name them — the human part (pairs, 5 min)
- ☐7
For each cluster, find the average weight and sweetness, e.g.
=AVERAGE(B2:B14). - ☐8
Name each cluster in F2–F4: "big and sweet: eating apples"… Compare with the next pair. Same clusters? Same names?
No laptop today?
Pairs get 20 paper apple cards (weight and sweetness). Place them on a grid drawn on the desk, push close cards into piles, count the piles and name each one.
Debate it
A shopping app clusters its customers and finds a group that "buys a lot at night". It starts showing that group extra advertisements after 10 pm.
Is that helpful, or is it using people's habits against them? Should children ever be put in clusters like this? (Hint: remember what India's DPDP Act says about tracking children.)
Check yourself — practice, not a test
1. Clustering needs labelled data before it can start.
- ○ True
- ○ False
2. Clustering is mainly used to:
- ○ Predict tomorrow's rainfall in millimetres
- ○ Group similar items together without labels
- ○ Check a password
- ○ Sort names in A–Z order
3. After the machine finds clusters, what does a person usually do?
- ○ Delete them
- ○ Look at each cluster and give it a meaningful name
- ○ Nothing, because the machine names them
- ○ Add labels to the training data first
4. Match each example to its technique:
Photo app groups pictures of the same person, with no names given · Mail app puts messages into spam or not spam · App predicts how many tourists will come in May
Match with: Clustering · Regression · Classification
Remember
Clustering = the machine finds the groups; people decide what the groups mean.
Typing practice
Skill: numbers + Tab (7 min)
- On typing.com, do a number row practice lesson.
- In Calc, practise moving along a row with Tab and down to a new row with Enter. Type
these three rows:
180 Tab 6 Enter·95 Tab 9 Enter·140 Tab 3 Enter