← IGCSE Computer Science Paper 1

Examples of machine learning

A program that improves from experience, e.g. spam filters, shopping or video recommendations, predictive text and game-playing programs that get better the more they are used.

Understanding Examples of machine learning in IGCSE Computer Science Paper 1

What it does: The game result is fed back in as experience and the program's performance changes, so it gets better the more it plays. The stored data is updated from the user's typing, so future suggestions are adapted to that user. This is machine learning from experience. Recommendations improve as the system learns from your viewing history. A calculator follows fixed steps and does not learn.

Common mistakes: A spam filter is machine learning, so it must learn from examples. Line 1 should train it on emails the user has marked as spam, not on no emails. A video recommendation system improves from experience. It must learn the user's likes from their watch history, not ignore it.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 662–678) and word search (Modules 652–678).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A spam filter becomes better at spotting junk email after users keep marking messages as spam. Which idea does this show?
Machine learning: the filter improves from experienceA fixed program: it never changes how it works
Matches
IF email CONTAINS "free" THEN spam (rule never changes)
↓
A fixed rule that never changes is not machine learning, because the program does not improve from experience
Applying
Meanings
Term
machine learning
Meaning
A program that improves from experience, e.g. spam filters, shopping or video recommendations, predictive text and game-playing programs that get better the more they are used.
Practice
IF user_marked_spam THEN
Testing
Gaps
result ← model.(email)
Check Answer
Spots
1TRAIN filter ON no emails
2FOR EACH new email

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Blobfish' badge — Pressure Handler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A spam filter becomes better at spotting junk email after users keep marking messages as spam. Which idea does this show?
A. Machine learning: the filter improves from experience ✓
B. A fixed program: it never changes how it works
Each message marked as spam gives the filter more data to learn from, so its decisions improve over time. This is machine learning.
2. Which is a machine learning example?
A. A calculator adding two numbers the same way every time
B. A video app suggesting new clips based on what you have watched ✓
Recommendations improve as the system learns from your viewing history. A calculator follows fixed steps and does not learn.
3. A shopping website learns which products a customer tends to buy and suggests similar items. What does it use to improve its suggestions?
A. A programmer rewriting the code after every sale
B. Past purchases and browsing data ✓
A recommendation system learns from the customer's data and adapts. It does not need a programmer to change the code each time.
4. A chess program plays thousands of games and gradually wins more often. Is this machine learning?
A. Yes: it improves from experience of games played ✓
B. No: game programs cannot improve at all
A game-playing program can learn which moves lead to wins and adapt its play. That improvement from experience is machine learning.
5. Predictive text on a phone starts suggesting the words you use most often. Which statement is correct?
A. It learns from what you type and adapts its suggestions ✓
B. It only ever uses a fixed list of words that cannot change
Predictive text adapts to the user's typing habits, which is an example of machine learning.

Match the Pairs

spam_filter.learn(email, "spam") → A spam filter learns from an email the user marked as spam, so it spots similar emails better in future
recommend(history) → A recommendation system uses what a user has watched or bought to suggest videos or products they may like
A game-playing program improves because it learns from the results of games it has played → win_rate ← win_rate + learn(game_result)
Predictive text learns which words a user types often and suggests them sooner → word_count[word] ← word_count[word] + 1
IF email CONTAINS "free" THEN spam (rule never changes) → A fixed rule that never changes is not machine learning, because the program does not improve from experience
suggestions ← same_list_for_everyone → Showing the same list to everyone ignores past behaviour, so it is not a learning recommendation system

Key Term

machine learning
A program that improves from experience, e.g. spam filters, shopping or video recommendations, predictive text and game-playing programs that get better the more they are used.

Fill in the Blanks

1. result ← model.predict(email)
Hint: Type the method name that asks the trained spam filter model for its guess about an email.
2. model.train(email, "spam")
Hint: Type the method name that lets the filter learn from a new labelled example so it improves with experience.
3. suggestion ← recommend(watchedVideos)
Hint: Type the function name that suggests new videos or products based on what the user did before.
4. FOR game ← 1 TO 1000
Hint: Type the keyword that sets the end value of the loop, so the game-playing program gets lots of practice.
5. nextWord ← model.predictNext(word)
Hint: Type the method name that makes predictive text guess the word the user will type next.

Spot the Error

Question 1
A TRAIN filter ON no emails
B FOR EACH new email
C IF filter says spam THEN
D MOVE email TO junk
E ENDIF
Line A — A spam filter is machine learning, so it must learn from examples. Line 1 should train it on emails the user has marked as spam, not on no emails.
Question 2
A watched ← video user played
B history ← history + watched
C likes ← IGNORE history
D SHOW videos matching likes
Line C — A video recommendation system improves from experience. It must learn the user's likes from their watch history, not ignore it.
Question 3
A FOR round ← 1 TO 1000
B PLAY round
C IF game won THEN
D punish moves used
E ENDIF
F NEXT round
Line D — A game-playing program improves by rewarding the moves that led to a win. Punishing them would make it play worse, so the line should be reward moves used.
Question 4
A word ← last word typed
B next ← rarest word after word
C SHOW next AS suggestion
D UPDATE counts FROM user typing
Line B — Predictive text learns which words are used most often. It should suggest the most common word that follows, not the rarest.
Question 5
A READ customer eye colour
B FIND similar customers
C RECOMMEND what they bought
Line A — Shopping recommendations learn from past behaviour. The program should read the customer's purchase history, which is relevant data, not their eye colour.

Student with a class code? Join your class →