Skip to main content

Lesson 1 — The three families of learning

Machine learning is split into families according to what the training data tells the model. Getting this classification right is the first decision in any project, because it determines what is possible and how you will know whether it worked.

Supervised learning: you have the answers

In supervised learning, every training example comes with its correct answer. Ten thousand emails each labelled spam or not spam. Fifty thousand houses each with the price it sold for.

The model learns to reproduce that mapping, and the crucial consequence is that you can measure it. Hold back examples, ask for predictions, compare against the truth. That measurability is why supervised learning accounts for the overwhelming majority of deployed systems.

It splits in two, by the type of the answer:

Classification predicts a category.

  • Spam or not spam. Two categories, so binary classification.
  • Which of twelve product types is in this photograph. Multi-class.
  • Which of these tags apply to this article, possibly several. Multi-label.

Regression predicts a number.

  • What will this house sell for.
  • How many units will we ship next month.
  • How many days until this machine fails.

The distinction matters because it decides your loss function and your metrics. A classifier is measured with precision and recall; a regressor with average error. Confusing the two produces meaningless evaluations, and it happens: predicting a rating from 1 to 5 can be framed either way, and the framing changes what "wrong" means.

The real cost of supervised learning

Labels. They rarely exist for free. Getting ten thousand correctly labelled examples means either an event that naturally records the answer — a customer disputed a charge, a machine broke, a user clicked — or people doing the labelling. Any project whose plan starts with "we will label the data" should be budgeted as a labelling project with a modelling phase at the end.

Unsupervised learning: you have no answers

Here the data has no labels. You have a hundred thousand customers with their behaviour, and nobody has said which segment each belongs to — because the segments do not exist yet. The model looks for structure.

Clustering groups similar examples. Customer segmentation, grouping documents by topic, finding families of similar products. The algorithm produces groups; what the groups mean is entirely your interpretation, and that is the honest limitation. k-means will happily return five clusters because you asked for five, whether or not five is a natural number for your data.

Anomaly detection finds examples unlike the rest. Fraud, manufacturing defects, intrusion attempts, failing sensors. This is heavily used precisely because anomalies are, by nature, too rare and too varied to label in advance.

Dimensionality reduction compresses many features into few while keeping most of the information. Used to visualise high-dimensional data, to speed up later models, and to remove redundancy.

The difficulty of unsupervised learning is evaluation. With no ground truth, there is no accuracy to compute. You are left with internal measures of how tight and separated the clusters are, and with human judgement about whether the result is useful. Two people can reasonably disagree about whether a clustering is good, which never happens with a test set.

Reinforcement learning: you learn from consequences

The third family looks different. There is no dataset. There is an agent taking actions in an environment, receiving a reward or a penalty, and adjusting to earn more reward over time.

This is how game-playing systems learn, how robots learn to move, and how some recommendation and control systems are trained. It is also how modern language models are aligned with human preferences, through a technique that reinforces responses people rated more highly.

Two properties make it hard.

Delayed reward. In chess the only unambiguous signal arrives at the end. Which of your forty moves deserves credit for the win is genuinely difficult to determine, and this credit assignment problem is the central technical challenge.

Exploration versus exploitation. Should the agent repeat what has worked, or try something new that might work better? Too much exploitation and it settles for a mediocre strategy forever. Too much exploration and it never converges. There is no universally correct balance.

Reinforcement learning also needs an environment where mistakes are cheap, which usually means a simulator. This is why it dominates games, where a million trials cost nothing, and struggles in domains where each trial involves a real machine, a real patient or real money. The premium reinforcement learning course goes deeper.

The two you will hear about

Between the main families sit two approaches that matter commercially.

Semi-supervised learning uses a small labelled set together with a large unlabelled one. Since labels are expensive and raw data is cheap, this is a common practical compromise: label a thousand examples, use a hundred thousand to learn the shape of the data.

Self-supervised learning generates its own labels from the structure of the data. Hide a word in a sentence and predict it. Hide part of an image and reconstruct it. This deserves attention because it is how every large language model is trained: the label is simply the next word, which means the entire internet becomes labelled data at no cost. That trick is arguably the single most consequential idea of the last decade.

Deciding which family your problem is

That last box is not a joke. A significant fraction of problems presented as machine learning problems are better solved by a query, a rule or a fixed calculation. Reaching that conclusion early is a good outcome, not a failure.

The question that reframes projects

When someone asks for clustering, ask what decision the groups will drive. Frequently the real need was supervised — "which customers will churn" — and clustering was proposed because nobody had gathered the labels. Naming that early changes the whole project plan.


In three sentences

Supervised learning has the answers attached, which makes it measurable and is why it dominates production; it splits into classification for categories and regression for numbers. Unsupervised learning has no answers and looks for structure, so its output requires human interpretation and cannot be scored against a truth. Reinforcement learning has no dataset at all, learning from delayed rewards, and needs an environment where mistakes are cheap — while self-supervised learning, which invents its own labels, is what made large language models possible.


NextLesson 2: the algorithms and when to use them →