Foundations · Module 3

Supervised and unsupervised learning

When we say a model learns, we mean it changes its internal settings so it can make better guesses.

1h 4 outcomes AI Foundations

Previously

Data and representation

In AI, the word data sounds fancy, but it is usually boring.

This module

Supervised and unsupervised learning

When we say a model learns, we mean it changes its internal settings so it can make better guesses.

Next

Responsible AI basics and limitations

AI systems can cause harm even when everybody is trying to do the right thing.

Progress

Mark this module complete when you can explain it without rereading every paragraph.

Why this matters

Glossary Tip.

What you will be able to do

  • 1 Explain supervised and unsupervised learning in your own words and apply it to a realistic scenario.
  • 2 The learning paradigm follows from what you have, what you want, and what error costs you.
  • 3 Check the assumption "Success can be defined" and explain what changes if it is false.
  • 4 Check the assumption "You can tolerate mistakes" and explain what changes if it is false.

Before you begin

  • No previous technical background required
  • Read the section explanation before using tools

Common ways people get this wrong

  • Optimising the wrong target. A high score can hide harm. If the metric is not aligned with the goal, the model gets good at the wrong job.
  • False certainty. A model output is not a fact. When uncertainty is high, the system should slow down and ask for a better input.

Main idea at a glance

Two ways models learn from data

Supervised has answers. Unsupervised searches for structure.

Stage 1

Do I have labelled answers?

I start by asking whether my training data has correct answers attached. This choice splits my approach entirely.

I think this is the most important branching point in model building.

When we say a model learns, we mean it changes its internal settings so it can make better guesses. It is not learning like a person learns. It is closer to practice. You show examples, it adjusts, and it gets less wrong over time.

Interactive lab

Glossary Tip

This module includes an interactive practice component. Open the deeper tool or workspace step when you want to test the idea rather than only read it.

Interactive lab

Glossary Tip

This module includes an interactive practice component. Open the deeper tool or workspace step when you want to test the idea rather than only read it.

In supervised learning, you give the model an input and an answer. The model tries to guess the answer, then it is corrected. Over many examples, it learns a pattern that can generalise to new cases.

Email spam filtering is a classic supervised example. You have emails, and you have labels like spam and not spam. Image classification is another. You have images, and you have labels like cat, dog, or receipt. House prices are supervised too, but the answer is a number. The same pattern applies. Inputs in, answer attached, model learns to predict.

There are two common supervised shapes.

Interactive lab

Glossary Tip

This module includes an interactive practice component. Open the deeper tool or workspace step when you want to test the idea rather than only read it.

Interactive lab

Glossary Tip

This module includes an interactive practice component. Open the deeper tool or workspace step when you want to test the idea rather than only read it.

The difference matters because the mistakes feel different. A wrong category can block a real email. A wrong price can cost real money.

Interactive lab

Glossary Tip

This module includes an interactive practice component. Open the deeper tool or workspace step when you want to test the idea rather than only read it.

Instead of asking "what is the right label", you ask "what patterns exist". This is useful when labels are missing, expensive, or not even well defined.

Grouping customers by behaviour is a common unsupervised example. You might discover that one group buys weekly and another group buys once a year. Topic discovery in documents is another. You might find clusters of themes in support tickets without anyone labelling them by hand. Anomaly detection is a third. You look for unusual behaviour that might signal fraud or intrusion.

Unsupervised learning is harder to evaluate because there is no single correct answer waiting in a spreadsheet. If you change your settings, the groupings can change. Sometimes both results are reasonable. You have to judge usefulness, not just score points.

Imagine a bank clustering transactions to find “normal” behaviour. If the system learns that weekend spending is “unusual” for a certain group, it might flag normal customers as fraud. Unsupervised results still need human judgement and context.

In practice, teams use clustering to create segments and then make decisions based on those segments. That means errors in the clustering can become policy, pricing, or access decisions. Treat cluster labels as hypotheses, not truth.

Here are a few beginner misconceptions to avoid. First, more data is not always better data. If it is biased or messy, you scale the problem. Second, unsupervised learning is not a free shortcut. It still needs careful interpretation. Third, a model learning a pattern does not mean it understands a reason. It means it found a shortcut that worked on the training data.

Worked example. A classifier that is "accurate" and still useless

Worked example. A classifier that is "accurate" and still useless

Suppose only 1% of transactions are fraud. A lazy model that always predicts “not fraud” gets 99% accuracy. It is also worthless. This is why I keep saying: one metric can lie to you.

In real systems, you usually care about questions like: how many real fraud cases did we catch (recall), how many innocent people did we annoy (false positives), and what is the operational cost of review.

Common mistakes in learning paradigms

Learning paradigm mistakes

  1. Assuming supervised labels are ground truth

    Labels can be noisy, biased, or outdated, so supervised training still needs judgement.

  2. Treating cluster names as real categories

    Unsupervised groupings are hypotheses, not fixed truth about people or behaviour.

  3. Rewarding one metric and ignoring side effects

    The model optimises what you score, even when it harms other outcomes.

Verification. Prove you understand the evaluation question

Evaluation reasoning drill

  1. Choose the error that hurts most

    For spam, fraud, or triage, explain which failure has the larger real-world cost.

  2. Set a borderline-case policy

    Define review, escalation, or defer rules before the model goes live.

  3. Distinguish uncertainty from confident error

    Uncertainty needs support signals. Confident error needs faster controls and correction.

After this section you should be able to

Section outcomes

  1. Explain when supervised learning is appropriate and what it optimises for

    Map labelled tasks to the correct metric and decision boundary.

  2. Explain when unsupervised learning is useful and why evaluation is harder

    Judge usefulness instead of assuming there is one objectively correct grouping.

  3. Explain what breaks when people treat model outputs as understanding

    Recognise shortcut learning and prevent over-trust in fluent outputs.

Mental model

Choosing a learning setup

The learning paradigm follows from what you have, what you want, and what error costs you.

  1. 1

    Do you have labelled outcomes

  2. 2

    Supervised learning

  3. 3

    Unsupervised learning

  4. 4

    Do actions change the world

  5. 5

    Reinforcement learning

Assumptions to keep in mind

  • Success can be defined. If you cannot say what good means, models will optimise the wrong thing. The best metric is the one tied to a real decision.
  • You can tolerate mistakes. Some errors are acceptable and some are not. Safety comes from deciding this early, not after a failure.

Failure modes to notice

  • Optimising the wrong target. A high score can hide harm. If the metric is not aligned with the goal, the model gets good at the wrong job.
  • False certainty. A model output is not a fact. When uncertainty is high, the system should slow down and ask for a better input.

Check yourself

Quick check. Supervised and unsupervised learning

0 of 12 opened

Scenario. After training, the model gets better at predicting from examples. In plain language, what changed

It adjusted its internal settings so it makes better guesses from examples.

Scenario. You accidentally train and test on the same emails. Why is that a problem

You are grading your own homework. It makes results look better than real performance.

Scenario. You have thousands of emails labelled spam or not spam. What makes this supervised

Examples include the correct answer the model should learn to predict.

Scenario. You have no labels, but you want to group customers by behaviour. What makes this unsupervised

Examples have no answers, so the model looks for patterns or structure.

Scenario. A model predicts 'spam' vs 'not spam'. What type of task is that

Classification: predicting a category.

Scenario. A model predicts a delivery time in minutes. What type of task is that

Regression: predicting a number.

Scenario. Why is unsupervised learning harder to evaluate

There is no single correct answer, so usefulness depends on interpretation and context.

Scenario. A clustering tool produces five clusters with neat names. What is a practical risk

Over-interpreting clusters as 'real categories' when they are just one grouping choice.

Scenario. You train a classification model and it learns patterns. What does 'training' actually do in technical terms

It adjusts internal parameters to minimise prediction error on training examples, learning a mapping from inputs to outputs.

Scenario. A model that predicts fraud has high precision but low recall. What does that mean in plain terms

When it says fraud, it is usually correct, but it misses many real fraud cases because it is too conservative.

Scenario. Why do we use validation data separately from training data

To make honest choices during model building without cheating by testing on the same data the model learned from.

Scenario. You discover your unsupervised clustering groups customers differently each time you run it. Is this normal

Yes, unsupervised results can vary with settings. You must judge usefulness and consistency, not assume a single correct answer.

Artefact and reflection

Artefact

A short module note with one key definition and one practical example

Reflection

Where in your work would explain supervised and unsupervised learning in your own words and apply it to a realistic scenario. change a decision, and what evidence would make you trust that change?

Optional practice

Adjust distance, grouping, and ambiguity. See how reasonable clusters can still mislead if you treat them as truth.

Also in this module

Train a tiny classifier

Adjust how much training data you have and how noisy it is. Notice how it changes expected accuracy and stability.

Threshold trade-offs playground

Move the decision threshold and watch false positives and false negatives change. Practise picking a threshold that matches the real-world cost.