🎯 Syllabus & Goals 3 min
Cambridge 6.3 · AI systems — machine learning Paper 1 · Computer Systems
By the end of this lesson you can:
- Define machine learning and explain how it differs from AI in general and from an expert system.
- Describe how machine learning is used for search engines, spam filtering, recommendations and fraud detection.
- Describe the stages of building a machine learning model, including training and testing.
Textbook: Chapter 6, §6.3.3 (pp. 246–251) — machine learning.
Recap / Warm-Up 5 min
An expert system reasons with facts and rules that humans put in. Machine learning is the other AI system on the syllabus: it finds its own rules from data.
Quick starter
Which expert-system component stores facts as objects and attributes?
Reveal the answer
The knowledge base. (The rules base holds the IF rules; the inference engine uses both.)
🧠 Key Concept 14 min
1 · What is machine learning?
It is trained with sample data, then makes predictions or decisions about new, unseen data. Powerful processing lets it handle huge, complex data sets that would take humans years to analyse.
2 · A search engine that learns
3 · AI vs machine learning vs expert system
| AI (in general) | Machine learning | Expert system | |
|---|---|---|---|
| What it is | Simulated intelligence in machines | Getting machines to make decisions without being programmed to do so | Mimics a human expert's decisions |
| Aim | Machines that think like humans | Machines that learn from data to solve new problems | Expert advice without the expert |
| Where rules come from | — | Found by the algorithm from training data | Written by humans from expert knowledge |
4 · Three uses of machine learning

Worked Example 12 min
(a) A tiny spam filter learns from training data
The training data set: six emails already labelled by people.
| # | Email (after cleaning: stop words and punctuation removed) | Label |
|---|---|---|
| 1 | won free prize claim now | spam |
| 2 | free lottery ticket won | spam |
| 3 | claim refund free | spam |
| 4 | meeting moved friday | not spam |
| 5 | homework due friday | not spam |
| 6 | free period after lunch | not spam |
- Train: count how often each word appears in spam vs not spam.free 3 : 1 · won 2 : 0 · claim 2 : 0 · friday 0 : 2the model learns its own rules from examples — nobody writes "IF free THEN spam".
- New, unseen email: "Congratulations you won a free cruise". Cleaned → congratulations won free cruise.new data goes through the same cleaning as the training data.
- Score: spam evidence = won 2 + free 3 = 5; not-spam evidence = free 1 = 1. Unknown words are ignored.compare the weight of evidence on each side.
- Predict: 5 > 1 → move to the spam folder.a prediction about data it was never programmed for.
- Adapt: if the user clicks "not spam", that email joins the training data and the counts change.the program adapts its own data — the syllabus definition in action.
(b) Collaborative filtering makes a recommendation
| Customer | Jazz album | History book | Running shoes | Cookbook | Headphones |
|---|---|---|---|---|---|
| Alex | ✔ | ✔ | ✔ | ||
| Sam | ✔ | ✔ | |||
| New customer | ✔ | ✔ | ? | ? | ? |
- Count items the new customer shares with each existing customer: Alex 2, Sam 0.similar shopping behaviour = more shared items.
- Alex is the most similar customer.collaborative filtering compares customers, not products.
- Recommend what Alex bought that the new customer has not: running shoes."customers who bought this also bought…"
- If the customer buys them, the pattern is reinforced for future customers.learning from past experience.
Try It Yourself 12 min
Goal: Put in order: building a model · data cleaning · model evaluation · data collection · exploration and analysis.
Goal: Using the spam counts above, classify "claim your free homework help friday". Show the spam and not-spam scores.
Goal: A bank wants to detect fraudulent card payments. Describe what happens at each of the five model-development stages, with an example of the data used at each.
Hint
Collect: transaction amounts, places, times. Clean: remove duplicates and irrelevant fields. Explore: typical spend per customer. Train on known fraud and genuine cases. Evaluate with known outcomes; retrain if too many false alarms.
📝 Exam Practice 10 min
Define the term machine learning.
Mark scheme
- A sub-set of AI in which algorithms are trained (with data) (1)…
- …and learn from past experiences / examples; can adapt its own processes and/or data (1).
Explain how machine learning differs from artificial intelligence in general.
Mark scheme
- AI is simulated intelligence / aims to build machines that think like humans (1).
- Machine learning gets machines to make decisions without being programmed to, by learning from data to solve new problems (1).
Describe how a search engine could use machine learning to improve its results.
Mark scheme
- It records whether the user picks a result from the first page (1).
- A page-1 choice is classed as a success; going to later pages is a failure (1).
- It learns from this past performance and adjusts future rankings, becoming more accurate (1).
Describe how machine learning is used to decide whether an email is spam.
Mark scheme
- Data about emails is collected (content, headers, sender) (1).
- Data is cleaned — stop words and punctuation removed (1).
- A model is trained using a training data set of emails known to be spam; spam words/phrases are identified (1).
- New emails are compared with the model and predicted spam is moved to the spam folder; the model is fine-tuned / keeps learning (1).
🗝️ Recap & Key Terms 3 min
Machine learning trains algorithms on example data so they can predict and decide about new data. It adapts its own processes and data as it goes. Search engines, spam filters, recommendations and fraud detection all rely on it.
- Machine learning
- A sub-set of AI in which algorithms are trained and learn from past experiences and examples.
- Training data set
- Example data with known outcomes used to train a machine learning model.
- Data cleaning
- Removing redundant or irrelevant data (e.g. stop words, punctuation) before training.
- Collaborative filtering
- Recommending items by comparing customers who have similar shopping behaviour.
- Web scraping
- A method of obtaining data from websites.
Homework 1 min
Task (≤ 15 min): A music streaming app builds a personal playlist for each user. Describe how machine learning could do this. [4]
Model answer
- The app collects data on what each user plays, skips and saves (1).
- It compares users with similar listening behaviour — collaborative filtering (1).
- It recommends songs that similar users liked but this user has not heard (1).
- It learns from whether the user plays or skips the suggestions, so playlists improve over time (1).