Foundations to Frontier
Tests
D. Classical Machine Learning › D0 Core Concepts (concept pages)

Types of Learning: Supervised, Unsupervised, Semi-Supervised, Self-Supervised and Reinforcement

Machine learning methods differ mainly in what feedback they get. Supervised learning has a correct answer for every training example; unsupervised learning has none and looks for structure; semi-supervised learning combines a few labels with many unlabeled examples; self-supervised learning creates its own labels from the data; and reinforcement learning only receives rewards for its actions. This page defines each paradigm, shows where each is used, and explains the assumptions that let unlabeled data help. In the exercises you implement a tiny learner of each kind on the same data; then you measure how many labels supervised and semi-supervised methods need on clustered and on curved (two-moons) data.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Five ways to learn

Imagine learning to sort fruit. A teacher could name every fruit you pick up (supervised). You could be left alone with a pile and group similar fruits yourself (unsupervised). The teacher could name just a few and let you work out the rest (semi-supervised). You could cover half of a fruit and practise guessing the hidden half, learning what fruits look like without anyone’s help (self-supervised). Or you could get a sweet when you sort well and nothing when you don’t (reinforcement).

One dataset, three ways to learn
data: learning:
labels used: 2 · points coloured with their true class: 100%
Unsupervised k-means only finds groups (we name them afterwards by majority); it splits the moons wrongly because it assumes round clusters. Semi-supervised learning spreads a handful of labels along chains of close neighbours, so one label per moon can be enough. Self-supervised and reinforcement learning are not shown: they create labels from the data itself, or learn from rewards.
Why engineers care

Labels are expensive: an expert must mark each satellite image, each fault in telemetry, each grasp attempt. Choosing the paradigm that fits the feedback you can actually get (a few labels, lots of raw logs, a reward from a simulator) is the first design decision of any ML system.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Learning from examples that all come with the right answer is…
  2. 2. Grouping customers with no labels at all is…
  3. 3. A robot learning to walk from a reward for distance travelled uses…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The paradigms side by side

Paradigm Training signal Typical tasks Classical examples
Supervised input–label pairs (x, y) classification, regression linear and logistic regression, trees, SVMs, kNN
Unsupervised inputs x only clustering, dimensionality reduction, density estimation, anomaly detection k-means, GMM, PCA, DBSCAN, isolation forest
Semi-supervised few labeled + many unlabeled classification with scarce labels self-training, label propagation, transductive SVM
Self-supervised labels made from x (masked parts, next item, augmentations) pretraining representations word2vec, masked language models, contrastive learning
Reinforcement rewards for actions in an environment control, games, recommendation bandits, Q-learning, policy gradients

Related settings: online learning (data arrive one at a time), active learning (the learner chooses which examples to label), weak supervision (noisy or programmatic labels), transfer learning (reuse a model trained on another task).

from sklearn.linear_model import LogisticRegression          # supervised
from sklearn.cluster import KMeans                            # unsupervised
from sklearn.semi_supervised import LabelSpreading           # semi-supervised (y = -1 for unlabeled)
LogisticRegression().fit(X, y); KMeans(3).fit(X); LabelSpreading().fit(X, y_partial)
📝 Quick check (Level 1)
0/3 answered
  1. 1. In scikit-learn semi-supervised estimators, unlabeled points are marked…
  2. 2. Masked-word prediction for pretraining is…
  3. 3. A learner that asks a human to label the most useful example is doing…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.

Formal settings

  • Supervised: data (xᵢ, yᵢ) drawn i.i.d. from P(x, y); find f minimising the expected loss E[ℓ(f(x), y)] (B1.1).
  • Unsupervised: data xᵢ from P(x); estimate P(x) or a structure of it, such as clusters, a low-dimensional manifold or outliers.
  • Semi-supervised: labeled set L and unlabeled set U, usually |L| ≪ |U|. Unlabeled data help only through an assumption linking P(x) to P(y | x):
    • cluster assumption: points in the same cluster share a label;
    • low-density separation: decision boundaries pass through sparse regions;
    • manifold assumption: labels vary smoothly along the data manifold.
  • Self-supervised: build a pretext task (x̃, t) = g(x), such as hiding part of x, and learn a representation h that solves it; then use h for downstream tasks with few labels.
  • Reinforcement: an agent in state s chooses action a, receives reward r and next state s′; maximise expected return E[Σ γᵗ rₜ]. The data depend on the agent’s own choices, so it must explore.
🐍 Exercise 1: one learner of each kind
On three 2-D Gaussian groups, train a nearest-centroid classifier with all labels, run k-means with no labels and score its clusters after matching, self-train a nearest-centroid model from one label per class, fit a self-supervised pretext regression, and let an ε-greedy agent learn the best of three bandit arms from rewards.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Unlabeled data can help a classifier only if…
  2. 2. Why must an RL agent explore?
  3. 3. Cluster accuracy is computed after…

Level 3: Advanced

★★★★☆ Advanced⏱ 30 minGraduate level, with full derivations and proofs.

Choosing a paradigm

  • Plenty of reliable labels: supervised learning is simplest and strongest.
  • Few labels, much raw data: first try self-supervised or unsupervised pretraining, then fine-tune; or use semi-supervised methods whose assumption fits the data. Check that assumption on a validation set: when it is wrong, unlabeled data can hurt.
  • No labels: unsupervised methods, judged with internal metrics (D0.14) and expert inspection.
  • Decisions with delayed consequences: reinforcement learning, ideally in simulation first.

Interview questions. What is the difference between self-supervised and unsupervised learning? (The first trains a predictive task with automatically created labels; the second models structure directly.) When does semi-supervised learning fail? (When clusters or manifolds do not align with classes.) Why are RL data not i.i.d.? (The policy determines which states are visited.)

📝 Quick check (Level 3)
0/3 answered
  1. 1. Self-training on data where clusters don't match classes can…
  2. 2. Modern foundation models are mostly pretrained with…
  3. 3. Unsupervised anomaly detection on telemetry needs…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How many labels does each approach need?

Exercise 1. On three Gaussian groups, nearest centroids with all 300 labels, k-means with none, and self-training from 3 labels all classify 98.7% of new points correctly. Here the groups are the classes, so labels mostly just name the clusters. An ε-greedy agent pulls the best of three arms 92% of the time.

Exercise 2: label efficiency on two datasets (three overlapping blobs and two moons; 400 unlabeled points, 500 test points; mean of 20 random draws).

Data, labels per class Nearest centroid 1-NN Self-training Label propagation Cluster-then-label
blobs, 1 0.924 0.924 0.974 0.944 0.958
blobs, 5 0.968 0.953 0.976 0.966 0.976
blobs, 50 0.973 0.958 0.975 0.966 0.975
moons, 1 0.725 0.725 0.720 0.963 0.625
moons, 5 0.781 0.951 0.746 0.997 0.721
moons, 50 0.790 1.000 0.758 1.000 0.750

On blobs, the cluster assumption holds. One label per class plus unlabeled data (self-training at 0.974) matches what supervised nearest centroids reach with 50 labels per class (0.973), which is near the overlap-limited ceiling. On moons, methods that assume round clusters stay below 0.80 however many labels they get. Label propagation, which assumes labels are smooth along the data manifold, reaches 0.963 from a single label per moon. Supervised 1-NN needs about 5–10 labels per class to catch up. Unlabeled data is powerful exactly when the method’s assumption matches the data’s geometry.

🐍 Exercise 2 (research): how many labels are enough?
On blobs and two moons, train nearest-centroid and 1-NN classifiers on 1–50 labels per class, and self-training, label propagation on a kNN graph and cluster-then-label with 400 extra unlabeled points; average test accuracy over 20 random draws.

Learning paradigms in AI, robotics and aerospace

  • Supervised: defect detection on labeled images, remaining-useful-life regression.
  • Unsupervised: anomaly detection in spacecraft telemetry (no labeled faults), clustering flight regimes.
  • Semi-supervised: land-cover mapping from a few ground-truth sites and many unlabeled satellite tiles.
  • Self-supervised: pretraining on unlabeled robot video or Earth-observation imagery.
  • Reinforcement: locomotion and manipulation policies trained in simulation, satellite scheduling.

References

  1. T. Mitchell (1997). Machine Learning. McGraw-Hill.
  2. O. Chapelle, B. Schölkopf, A. Zien, eds. (2006). Semi-Supervised Learning. MIT Press.
  3. X. Zhu, Z. Ghahramani (2002). “Learning from labeled and unlabeled data with label propagation.” CMU-CALD-02-107.
  4. R. S. Sutton, A. G. Barto (2018). Reinforcement Learning: An Introduction, 2nd ed. MIT Press.
  5. R. Balestriero et al. (2023). “A cookbook of self-supervised learning.” arXiv:2304.12210.