I5 · Machine Learning Foundations

Types of Machine Learning

Machine learning is usually divided by what the model learns from. Supervised learning uses labelled examples. Unsupervised learning finds structure with no labels. Semi-supervised learning mixes a few labels with much unlabelled data. Self-supervised learning creates its own labels from the data. Reinforcement learning learns from rewards.

10 min Intermediate · Sublevel Intermediate

What you need: The earlier topics of this module.

Definition

Machine learning is usually divided by what the model learns from. Supervised learning uses labelled examples. Unsupervised learning finds structure with no labels. Semi-supervised learning mixes a few labels with much unlabelled data. Self-supervised learning creates its own labels from the data. Reinforcement learning learns from rewards.

In simple words

Supervised is a teacher who gives answers while you practise. Unsupervised is being handed a pile of photos and sorting them into groups by yourself. Reinforcement is learning to ride a cycle: nobody gives you answers, you just fall or don't.

Overview

  • Machine learning is usually divided by the kind of feedback the model receives during training.
  • Supervised learning uses labelled examples; unsupervised learning uses unlabelled data.
  • Reinforcement learning learns from rewards after actions.
  • Semi-supervised and self-supervised learning reduce the need for expensive labels.
  • Large language models are pre-trained with self-supervision and then fine-tuned with supervision and reinforcement learning from human feedback.
  • The right type depends on what data and feedback you have.

Why it matters

The first decision in any ML project is which type fits. It depends on one thing above all: do you have labels? Labels are often the most expensive part of a project, so this choice shapes the cost.

Key terms

Supervised learning
Learning from inputs paired with correct outputs.
Unsupervised learning
Finding structure, such as groups, in data without labels.
Semi-supervised learning
Learning from a few labelled examples plus many unlabelled ones.
Self-supervised learning
Creating labels from the data itself, such as predicting the next word.
Reinforcement learning
Learning by trial and error from rewards and penalties.
Agent and reward
In reinforcement learning, the learner that acts, and the signal of how good an action was.

Types

There are five main types of machine learning. Each learns from a different kind of signal.

1. Supervised learning

Learning a mapping from inputs to known outputs using labelled examples.

  • How it works: The model compares its predictions with the true labels and adjusts to reduce the error; tasks are classification and regression.
  • Example: Learning to detect diabetic eye disease from retina images labelled by doctors.
  • When to use it: Use it whenever you have enough reliable labels for the thing you want to predict.

2. Unsupervised learning

Finding structure in data that has no labels.

  • How it works: Algorithms group similar items (clustering), compress features (dimensionality reduction) or find unusual points (anomaly detection).
  • Example: Segmenting a bank's customers by spending behaviour; compressing 64 pixel features with PCA.
  • When to use it: Use it to explore data, create features or find patterns no one thought to label.

3. Semi-supervised learning

Learning from a small labelled set plus a large unlabelled set.

  • How it works: Methods such as self-training label the unlabelled data with confident predictions and retrain, spreading information from the few labels.
  • Example: Classifying medical scans when only 500 of 50,000 have been labelled by radiologists.
  • When to use it: Use it when labelling is expensive but raw data is cheap.

4. Self-supervised learning

Creating labels automatically from the data itself, such as hiding part of an input and predicting it.

  • How it works: Language models predict the next or a masked word; vision models predict missing image patches; the learned representations are reused for other tasks.
  • Example: GPT models learning from billions of sentences by predicting the next token.
  • When to use it: Use it to pre-train large models on huge unlabelled data before fine-tuning.

5. Reinforcement learning

An agent learning to act through trial and error, guided by rewards.

  • How it works: The agent tries actions, receives rewards or penalties, and improves a policy to maximise long-term reward.
  • Example: Game-playing agents, robots learning to walk, and tuning chatbots with human feedback.
  • When to use it: Use it for sequential decisions where actions affect future outcomes and a simulator or feedback is available.

Explained in detail

The main families

TypeLearns fromTypical tasksExample
SupervisedLabelled examplesClassification, regressionPredicting loan default from past loans
UnsupervisedUnlabelled dataClustering, dimensionality reduction, anomaly detectionGrouping customers by shopping habits
Semi-supervisedA few labels, lots of unlabelled dataClassification when labelling is expensiveMedical images where only some are diagnosed by doctors
Self-supervisedLabels made from the data itselfPre-training large modelsPredicting the next word across billions of sentences
ReinforcementRewards from acting in an environmentGames, robotics, controlA program learning to play Go

Supervised learning in more depth

Supervised learning is the most widely used family in industry because many business questions come with historical answers: which past customers left, which transactions were fraud, what houses sold for. The cost is labelling. Labels often come from people, such as doctors marking scans or reviewers tagging content, and are slow, expensive and sometimes inconsistent. The quality of these labels sets a ceiling on any model, so a large part of practical machine learning is collecting good labels.

Self-supervision changed AI

Self-supervised learning removes the labelling bottleneck by hiding part of the data and asking the model to predict it. Mask a word in a sentence and predict it; predict the next word; hide a patch of an image and reconstruct it. Because any text or image can be turned into such a task, models can learn from enormous amounts of data without human labels. This is how large language models such as GPT and BERT, introduced in 2018, are pre-trained. They are then fine-tuned with a much smaller amount of labelled or human-rated data, sometimes using reinforcement learning from human feedback.

Reinforcement learning

  • An agent observes the state of its environment, takes an action and receives a reward.
  • It learns a policy, a rule for choosing actions, that maximises total reward over time, not just the next reward.
  • DeepMind's AlphaGo beat the Go champion Lee Sedol in 2016, combining reinforcement learning with deep networks.
  • A badly designed reward can be exploited: an agent rewarded for points in a boat-racing game learned to circle collecting bonuses instead of finishing the race.

How it works

TypeLearns fromTypical taskAlgorithms
SupervisedInputs with right answersPredict a label or a numberLinear regression, trees, SVM
UnsupervisedInputs onlyGrouping, compression, anomaliesK-means, PCA, DBSCAN
Semi-supervisedFew labels, much unlabelled dataReduce labelling costSelf-training, label propagation
Self-supervisedLabels made from the data itselfLearn representationsContrastive learning, BERT, GPT
ReinforcementRewards from actionsDecisions over timeQ-learning, PPO

Supervised has two kinds

  • Regression predicts a number, such as a house price.
  • Classification predicts a category, such as spam or not spam.

Common mistakes

  • Confusing clustering with classification. Classification has known labels, and clustering finds its own groups.
  • Treating a number that stands for a category as regression, like predicting a city code.

Check yourself

Question 1

1. Predicting tomorrow's temperature in °C is:

Question 2

2. You have no labels and want to group customers. Which type fits?

Question 3

3. How are LLMs mainly pre-trained?

Summary

  • The types differ by what the model learns from.
  • Supervised splits into regression (numbers) and classification (categories).
  • Do you have labels? Start there.

Read it. Now try it yourself.

Open the interactive activity

Finished reading?

Sources: Google Machine Learning Crash Course