IB Computer Science · A4 · Machine learning
A4.3 Machine learning approaches
Compare supervised, unsupervised and reinforcement learning, give suitable problems for each, and distinguish classification from regression.
1/6Learning approaches differ in the feedback they use
- Learning approaches differ in the feedback they use
- Supervised learning learns from labelled examples
- Classification predicts a category and regression predicts a number
- Unsupervised learning finds structure without labels
- Reinforcement learning improves behaviour through rewards
- The right approach depends on the data and goal
- Check your recall
- Practice: 10 questions
Part 1 of 6: Learning approaches differ in the feedback they use
Picture three students. One has homework with the answers supplied. One explores a new city and must spot patterns alone. One learns a game by trying moves and seeing what works. Machine learning approaches follow these three situations.
The key difference is the feedback available. In supervised learning the training data has labels, the known correct answers, and the model learns from them. In unsupervised learning there are no labels, so the model finds structure itself. In reinforcement learning a program learns from rewards.
Key terms · tap one for its definition
supervised learning
Supervised learning is machine learning in which a model is trained on labelled examples to predict the label of new cases.
unsupervised learning
Unsupervised learning is machine learning in which a model finds patterns or groups in unlabelled data.
reinforcement learning
Reinforcement learning is machine learning in which an agent learns actions that maximise its total reward through trial and error.
Part 2 of 6: Supervised learning learns from labelled examples
Start with supervised learning, since it is the most common. The model sees many examples with the correct label attached. It adjusts until its predictions match those labels, then predicts for new cases. The labels act like a teacher, so accuracy can be checked against known answers.
Typical problems include spam filtering, predicting house prices and recognising handwritten digits. Each needs a large set of examples with known answers. Producing those labels can be slow and costly. A model is judged on cases it did not see during training.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: A · Worked explanation
Part 3 of 6: Classification predicts a category and regression predicts a number
Within supervised learning, the type of label decides the task. Classification predicts a category from a fixed set, such as spam or not spam. Regression predicts a numerical value, such as tomorrow’s temperature or a house price. Regression outputs can take any value in a range.
A classification task can have two categories or many. Spam filtering has two. Recognising ten handwritten digits has ten.
Classification compared with regression
- Output
- Classification
- A category
- Regression
- A number
- Example
- Classification
- Will a loan be repaid?
- Regression
- How much will a customer spend?
- Judged by
- Classification
- Share of correct predictions
- Regression
- Size of the error
Key terms · tap one for its definition
classification
Classification is a supervised task in which a model predicts which category from a fixed set an item belongs to.
regression
Regression is a supervised task in which a model predicts a continuous numerical value.
Part 4 of 6: Unsupervised learning finds structure without labels
What if no answers are available? Unsupervised learning works with unlabelled data and looks for patterns. A common task is clustering, which groups similar items together.
A shop might cluster customers by buying habits, then design offers for each group. The groups are not named in advance. A person must decide what each group means. Unsupervised learning needs no labelling effort. Its results are harder to check, because there is no known right answer.
Another use is spotting unusual items that fit no group, such as a suspicious payment.
Key term
clustering
Clustering is an unsupervised task in which similar items are grouped together without predefined categories.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: B · Worked explanation
Part 5 of 6: Reinforcement learning improves behaviour through rewards
Neither earlier approach suits a robot learning to walk. Here an agent takes actions in a setting and receives a reward after each one. The reward can be positive or negative. A pet learning tricks from treats is a familiar comparison.
Over many attempts, the agent learns a strategy that earns the highest total reward. Game-playing programs and balancing robots are typical examples. No labelled examples are needed, but many trials are.
A badly designed reward can encourage behaviour the designer did not intend.
Key term
agent
An agent is the learner in reinforcement learning, which chooses actions and receives rewards from its setting.
Part 6 of 6: The right approach depends on the data and goal
Now compare the three side by side. The choice depends on what data you hold and what you want to achieve.
Three learning approaches
- Approach
- Supervised
- Training data
- Labelled examples
- Feedback
- Correct answers
- Example
- Predicting house prices
- Approach
- Unsupervised
- Training data
- Unlabelled data
- Feedback
- None
- Example
- Grouping customers
- Approach
- Reinforcement
- Training data
- Trial and error
- Feedback
- Rewards
- Example
- Robot learning to balance
With labelled data and a clear target, supervised learning fits. With only raw data, try unsupervised learning. When a sequence of decisions earns rewards, consider reinforcement learning. Real projects sometimes combine approaches, such as clustering first and then training a supervised model on the groups.
Check your recall[14 marks]
5 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.Distinguish[2 marks]
Distinguish between supervised and unsupervised learning.
Show mark schemeHide mark scheme
Model answer
Supervised learning trains on labelled data, so the model learns from known answers. Unsupervised learning uses unlabelled data and finds patterns or groups itself.
- 1 mark for stating that supervised learning uses labelled data with known answers
- 1 mark for stating that unsupervised learning uses unlabelled data to find structure
- 2.Distinguish[2 marks]
Distinguish between classification and regression.
Show mark schemeHide mark scheme
Model answer
Classification predicts a category from a fixed set, such as spam or not spam. Regression predicts a numerical value, such as a house price.
- 1 mark for stating that classification predicts a category
- 1 mark for stating that regression predicts a numerical value
- 3.Describe[3 marks]
Describe how reinforcement learning works.
Show mark schemeHide mark scheme
Model answer
An agent takes actions in a setting. After each action it receives a reward, which may be positive or negative. Over many trials it learns a strategy that earns the highest total reward.
- 1 mark for stating that an agent takes actions
- 1 mark for stating that it receives positive or negative rewards
- 1 mark for stating that it learns a strategy that maximises total reward over many trials
- 4.State[3 marks]
State the most suitable learning approach for each problem: (a) grouping customers when no categories exist, (b) predicting house prices from past sales with known prices, (c) a robot learning to balance.
Show mark schemeHide mark scheme
Model answer
(a) Unsupervised learning, using clustering. (b) Supervised learning, as a regression task. (c) Reinforcement learning.
- 1 mark for stating unsupervised learning for (a)
- 1 mark for stating supervised learning for (b)
- 1 mark for stating reinforcement learning for (c)
- 5.Discuss[4 marks]
Discuss when supervised learning is a suitable choice and when it is not.
Show mark schemeHide mark scheme
Model answer
It suits problems with a clear target, either a category or a number, where plenty of labelled examples exist. It is unsuitable when no labels exist or labelling is slow and costly. Unsupervised learning then fits better for finding groups. Reinforcement learning fits sequences of decisions that earn rewards.
- 1 mark for stating that it suits problems with a clear category or numerical target
- 1 mark for stating that it needs labelled examples
- 1 mark for explaining that it is unsuitable when labels are unavailable or costly to produce
- 1 mark for suggesting unsupervised or reinforcement learning as an alternative in the right situation

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
Easy[1 mark]
Show answer and explanation
Answer: C · Worked explanation
Medium[1 mark]
Show answer and explanation
Answer: D · Worked explanation
Medium[1 mark]
Show answer and explanation
Answer: A · Worked explanation
Medium[1 mark]
Show answer and explanation
Answer: B · Worked explanation
Medium[1 mark]
Show answer and explanation
Answer: C · Worked explanation
Hard[2 marks]
Show answer and explanation
Answer: A · Worked explanation
Hard[2 marks]
Show answer and explanation
Answer: B · Worked explanation
Hard[2 marks]
Show answer and explanation
Answer: D · Worked explanation