Skip to content
learn
  1. Learn
  2. Machine Learning
  3. Orientation

Machine Learning ML-00.02

Types of learning

Tell supervised, unsupervised, self-supervised, semi-supervised and reinforcement learning apart from a one-line problem statement.

Beginner 10 min Last reviewed

The big idea

All machine learning learns from data, but the data comes in very different shapes. Sometimes every example arrives with the right answer attached. Sometimes there are no answers at all, only a heap of raw examples. Sometimes the only feedback is a score that arrives long after you acted. Each situation needs a different kind of learning, and naming it correctly is the first decision in any ML project.

A good way to remember the families: think about how a person learns to cook. With a teacher who tastes every dish and says "too salty" or "perfect", that is supervised learning. Sorting a cupboard of unlabeled spices into groups by smell, with nobody telling you the names, is unsupervised learning. Covering half a recipe and guessing the missing step from the rest is self-supervised learning. And learning to run a busy restaurant, where the only feedback is whether customers come back next month, is reinforcement learning.

How it works

The family tree of machine learning Machine learning splits into supervised learning, with regression and classification beneath it; unsupervised learning, with clustering and dimensionality reduction; self-supervised learning; semi-supervised learning; and reinforcement learning. Each leaf has an everyday example. Regression Classification Supervised every example labeled Clustering Dim. reduction Unsupervised no labels Self-sup. labels from data Semi-sup. few labels Reinforce. rewards Machine learning predict a price spam or not group shoppers 300 cols to 3 next word few x-rays labeled win the game Figure 1. The five families. The question that sorts them: what feedback does the data come with?

Supervised learning: every example has an answer

In supervised learningLearning from examples that each come with the correct answer, so the model learns to map inputs to that answer., each training example has a label, and the model learns to predict it. It comes in two flavours, decided by what the label looks like:

  • RegressionSupervised learning where the label is a number, such as a price, a temperature or a delivery time.: the label is a number. House price, tomorrow's temperature, minutes until your food arrives.
  • ClassificationSupervised learning where the label is a category, such as spam or not spam, or which digit an image shows.: the label is a category. Spam or not spam, which of ten digits, which of 1,000 dog breeds.

Most ML in industry is supervised, because businesses often have historical outcomes: which loans defaulted, which customers cancelled, which transactions were fraud.

Unsupervised learning: find structure without answers

In unsupervised learningLearning from data with no labels, to discover structure such as groups, patterns or a simpler representation. there are no labels. The goal is to discover structure the data already has:

  • Clustering groups similar examples: customer segments, similar news stories, families of malware.
  • Dimensionality reduction squeezes many features into a few while keeping most of the information, for plotting or to speed up other models.
  • Anomaly detection flags examples that do not look like the rest, such as a server suddenly behaving oddly.

There is no right answer to check against, so judging the result needs care. You will learn the methods in k-means clustering .

Self-supervised learning: the data labels itself

Labels are expensive, but raw data is plentiful. Self-supervised learningLearning where the labels are created automatically from the data itself, for example by hiding part of an input and predicting it. manufactures labels from the data itself. Hide the next word of a sentence and predict it; hide a patch of a photo and reconstruct it. Every sentence on the internet becomes a free training example. This is how large language models are pretrained, before any human-written answers are involved.

Semi-supervised learning: a few labels, lots of data

Sometimes you have a small labeled set and a huge unlabeled one: 200 medical scans with a diagnosis and 50,000 without. Semi-supervised learningLearning from a small labeled set plus a large unlabeled set, using the unlabeled data to improve what the labels alone teach. uses the unlabeled pile to learn what normal data looks like, which makes the few labels go much further.

Reinforcement learning: learn from rewards

In reinforcement learningLearning by trial and error: an agent takes actions in an environment and learns which actions lead to the most reward over time. (RL), an agent acts in an environment and gets a reward signal, often delayed. Nobody says which move was right; the agent discovers it by trying. Game-playing agents, robot control and some recommendation systems work this way, and a form of RL is used to fine-tune chat models on human preferences. The full story is in RL fundamentals and MDPs .

Recognising the type from a problem statement

Ask three questions, in order:

  1. Is there a correct answer for each example? If yes, it is supervised (number: regression, category: classification).
  2. If not, can you create the answer automatically from the data itself? Then it is self-supervised.
  3. Is the feedback a reward for actions taken over time? Then it is reinforcement learning. Otherwise, you are looking for structure: unsupervised.

A small labeled set next to a large unlabeled one is the semi-supervised case.

Try it

Ten real problems. Which kind of learning fits each one?

Show answers
  • Predict a used car's sale price from 50,000 past sales: Supervised. Every past sale has the price that was paid: a labeled number, so regression.
  • Flag card fraud using transactions investigators marked fraud or not: Supervised. Labeled categories: classification.
  • Split shoppers into segments nobody has defined yet: Unsupervised. No labels; you want the groups the data already has. Clustering.
  • Compress 300 sensor readings into 3 numbers that keep most of the variation: Unsupervised. Dimensionality reduction needs no labels.
  • Spot unusual server behaviour with no record of past incidents: Unsupervised. Anomaly detection learns what normal looks like without labels.
  • Train a language model to predict the next word across billions of web pages: Self-supervised. The next word in the text is the label, created from the data itself.
  • Learn photo features by predicting a hidden patch of each image: Self-supervised. Hiding part of the input and predicting it creates free labels.
  • Classify scans when only 200 of 50,000 have a diagnosis: Semi-supervised. A few labels plus a big unlabeled set.
  • Teach a robot arm to grasp by rewarding successful grasps: Reinforcement. The only feedback is a reward for actions.
  • Choose which game move to make so you win at the end: Reinforcement. The reward (winning) comes long after the moves that earned it.

Try this:

  1. Sort all ten, press Check, and read the hint for any you missed.
  2. For the fraud problem, imagine investigators had labeled only 1 percent of transactions. Which bucket would it move to?
  3. Look at the two self-supervised items and say out loud where their labels come from.

Trade-offs

OptionWins whenLoses when
Supervised You have reliable labels for the outcome you care about Labels are expensive, slow or inconsistent to collect
Unsupervised You want to explore data or find groups and outliers without labels You need a specific prediction; results are hard to evaluate objectively
Self-supervised You have huge amounts of raw text, images or audio and want general-purpose representations Compute budget is small; you still usually need a supervised step for a specific task
Reinforcement Decisions happen in sequence and the outcome is a measurable reward Trial and error is unsafe or costly in the real world, and you cannot simulate it

Common mistakes

  • Calling every problem with numbers "regression". The question is whether the label is a number, not whether the features are.
  • Choosing unsupervised learning because labeling looks like work, when the business needs a specific prediction. Spend on labels instead.
  • Thinking self-supervised means "no human effort". Someone still chooses the pretext task, the data and the follow-up fine-tuning.
  • Reaching for reinforcement learning when there is a fixed dataset of past outcomes. That is usually supervised learning in disguise.

In the wild

You can spot all five families in products you use. Email spam filters and loan decisions are supervised classification, and delivery time estimates are supervised regression. Customer segmentation and "similar items" features often start with clustering. Large language models are pretrained with self-supervised next-word prediction, and chat assistants are then tuned with human feedback using a form of reinforcement learning. Game-playing systems such as chess and Go engines that learned from self-play are reinforcement learning.

Check yourself

  1. A model predicts how many minutes a food delivery will take, trained on past deliveries with their real durations. Which kind of learning?

    Show answer

    B. Regression Each past delivery has its real duration, a number. Supervised learning with a numeric label is regression.

  2. Where do the labels come from when a language model learns to predict the next word?

    Show answer

    B. From the text itself: the next word is the label Self-supervised learning hides part of the data and uses it as the target, so every sentence supplies free labels.

  3. You have 10 million product photos and 3,000 of them tagged with a category. What is the natural fit?

    Show answer

    B. Semi-supervised learning A small labeled set plus a large unlabeled set is exactly the semi-supervised setting.

  4. Which problem is the best fit for reinforcement learning?

    Show answer

    C. Control a warehouse robot that is scored on deliveries completed per hour The robot takes actions in sequence and is judged by a reward, which is the reinforcement learning setup.

Recap

  • Supervised learning learns from labeled examples: regression for numbers, classification for categories.
  • Unsupervised learning finds structure without labels: clusters, compressed features, anomalies.
  • Self-supervised learning makes labels from the data itself and powers large language model pretraining.
  • Semi-supervised learning stretches a few labels with lots of unlabeled data; reinforcement learning learns from rewards.
  • Pick the family by asking what feedback the data comes with.

Get new lessons by email

Get new posts on backend and AI internals. No spam, unsubscribe anytime.

Your email is only used to send new posts. Privacy

Next up