Class 6 · Unit 1: AI and everyday life · Lesson 1.5 · 45 min
Three ways machines learn
Hiba learns birds from names. Rahat sorts buttons with no names at all. Bazila falls off her bicycle and tries again. Machines learn in exactly these three ways.
Today you will: Train a real model on an apple and a pen · Find groups in data with no labels · Teach a “robot” with rewards
Story
Hiba, Rahat and their cousin Bazila are each learning something new.
Hiba is learning birds. Her grandfather points: that is a bulbul, that is a myna. She learns from examples with names.
Rahat tips out a box of buttons. Nobody tells him anything, but he puts them into piles: big ones, small ones, and shiny ones. He finds groups by himself.
Bazila is learning to ride a bicycle. She wobbles and falls (ouch!), tries again, and stays up a little longer (yes!). She learns from rewards and mistakes.
Machines learn in these same three ways.
Watch
Three ways machines learn — — scan code 6.1.5 in the printed book.
Learn it
Machines learn in the same three ways the children did. Like Hiba, a machine can learn from examples with names. Like Rahat, it can find groups by itself with no names at all. Like Bazila on her bicycle, it can learn by trying, with a reward when it does well. All three are kinds of Machine Learning.
Words to know
- Machine Learning (ML) a machine learning from data (the examples it is given) instead of following rules a person wrote.
- Training showing the machine data until it picks up the pattern.
- Model what training makes: the part that does the job afterwards, like telling an apple from a pen.
- Label the right answer that comes with an example, like the word "bulbul" with a bird photo.
- Supervised learning learning from examples with labels.
- Unsupervised learning finding groups in data with no labels. Finding groups is called clustering.
- Reinforcement learning learning by trying, with rewards for good moves and penalties for bad ones.
Step by step: which type is it?
| Type | Learns from | Examples |
|---|---|---|
| Supervised | examples with labels | photos labelled "cat" · bird photos labelled "bulbul" or "myna" · leaf photos labelled "healthy" or "scab" |
| Unsupervised | data with no labels | a phone gallery grouping photos of the same face · one odd reading among thousands |
| Reinforcement | trying, with rewards and penalties | a program learning ludo or chess · a robot learning to walk |
- Are there right answers (labels) in the examples? Then it is supervised.
- No labels, and the machine finds groups by itself? Then it is unsupervised.
- No examples at all, just trying and getting a reward or penalty? Then it is reinforcement.
The words of a reinforcement game. The agent is the learner (the robot). The environment is the world it moves in (the grid). The state is where it is now. An action is a move it makes. A reward is the score it gets: +1 for a good move, −1 for a bad one.
Careful: unsupervised does not mean no people are involved. People still choose the data, and a person must decide what each group means: the machine can make a pile of shiny buttons, but it cannot tell you they are the best ones. And reinforcement is mostly about rewards; a penalty just means less reward.
On the laptop
Three stations of 5 minutes. Groups rotate.
Mission 1: Supervised — labels (groups, 5 min)
- ☐1
teachablemachine.withgoogle.com → Get Started → Image Project → Standard — no account. Rename the classes
AppleandPen. - ☐2
Click Webcam: record about 30 images of an apple, then of a pen. Train Model — keep the tab open.
- ☐3
Predict: what will it call your eraser? Then hold up the apple, the pen, and the eraser. Why that guess?
(The images stay on the laptop unless you save them. Close the tab when done.)
Mission 2: Unsupervised — no labels (groups, 5 min)
- ☐4
Open
fruit-cards.ods: 12 fruits with weight (g) and colour, no names. - ☐5
Data → Sort by weight. Colour each group of similar fruits a different fill. How many groups?
Mission 3: Reinforcement — rewards (groups, 5 min)
- ☐6
Open
robot-path.ods: a 5×5 grid, Robot 🤖 top-left, Goal ⭐ bottom-right, 2 walls. - ☐7
One student is the robot and says a move; the partner types +1 for closer to the star, −1 for bumping a wall. Play 3 rounds — is round 3's score higher?
- ☐8
Label the agent, environment, state, action and reward in your sheet.
No laptop today?
- Supervised: the teacher shows 10 leaf cards labelled chinar or willow, then one with no label — the class guesses.
- Unsupervised: sort a bag of mixed buttons or beans into piles with no names.
- Reinforcement: chalk a 5×5 grid on the floor. A blindfolded "robot" gets a clap for a good step and a "buzz" for a wall.
Debate it
In Part 1, Teachable Machine was trained only on red apples. Then Rahat showed it a green apple, and it said "Pen"!
Whose mistake is that: the machine's, or the people who chose the examples? How would you fix it?
Check yourself — practice, not a test
1. Match each type of Machine Learning to its example:
Learning bird names from photos labelled "bulbul" or "myna" · A phone gallery putting photos of the same face together, with no names given · A game program that improves from its wins and losses · Spotting apple scab from leaf photos labelled "healthy" or "scab"
Match with: Reinforcement · Supervised · Unsupervised2. Rahat sorts buttons into piles without anyone telling him the groups. This is like:
- ○ Supervised learning
- ○ Unsupervised learning
- ○ Reinforcement learning
- ○ Automation
3. In supervised learning, the examples come with labels (the right answers).
- ○ True
- ○ False
4. Put the Teachable Machine steps in order:
- 1. Record examples
- 2. Train the model
- 3. Test with something new
- 4. Name the classes
5. In reinforcement learning, the machine learns from rewards and ______.
6. Training produces a ______, which is the part that does the job afterwards.
7. Match the reinforcement-learning word to your robot game:
Agent · Environment · Action · Reward
Match with: Moving right or down · The 5×5 grid · +1 for getting closer to the star · The robot
Remember
Labels → supervised. No labels → unsupervised. Rewards → reinforcement.
Typing practice
Skill: whole home row review (7 min)
- On typing.com, open Beginner → "Home Row Review".
- Type
asdf jkl;five times, then the wordssad,fall,lads,flask. - Check your own accuracy at the end. Did it go up since Lesson 1?