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.
★☆☆☆☆ 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. Learning from examples that all come with the right answer is…
2. Grouping customers with no labels at all is…
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
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).
1. In scikit-learn semi-supervised estimators, unlabeled points are marked…
2. Masked-word prediction for pretraining is…
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. Unlabeled data can help a classifier only if…
2. Why must an RL agent explore?
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. Self-training on data where clusters don't match classes can…
2. Modern foundation models are mostly pretrained with…
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
T. Mitchell (1997). Machine Learning. McGraw-Hill.
O. Chapelle, B. Schölkopf, A. Zien, eds. (2006). Semi-Supervised Learning. MIT Press.
X. Zhu, Z. Ghahramani (2002). “Learning from labeled and unlabeled data with label propagation.” CMU-CALD-02-107.
R. S. Sutton, A. G. Barto (2018). Reinforcement Learning: An Introduction, 2nd ed. MIT Press.
R. Balestriero et al. (2023). “A cookbook of self-supervised learning.” arXiv:2304.12210.
If P(y | x) is unrelated to P(x) (for example if labels are assigned independently of the input distribution’s structure), the unlabeled sample carries no information about the decision rule; semi-supervised methods then gain nothing over supervised ones and may lose through wrong assumptions.
What the learner is told (answers, nothing, a few answers, self-made answers, or rewards) determines which methods apply.
Practice
Show:
Level 0
Problem 1Level 0
Paradigm where every training example has a label?
Supervised.
Problem 2Level 0
Paradigm with no labels at all?
Unsupervised.
Problem 3Level 0
Paradigm that learns from rewards?
Reinforcement learning.
Level 1
Problem 4Level 1
Paradigm of masked-word pretraining?
Self-supervised.
Problem 5Level 1
Label scikit-learn uses for unlabeled points?
−1.
Problem 6Level 1
Running-mean estimate after rewards 1, 2, 3, 4?
2.5.
Problem 7Level 1
Cluster accuracy for clusters (0, 0, 0, 1) and labels (0, 0, 1, 1)?
0.75.
Level 2
Problem 8Level 2
Setting where the learner picks which examples a human labels?
Active learning.
Problem 9Level 2
Assumption label propagation relies on?
The manifold (smoothness) assumption.
Problem 10Level 2
Score for class 0 of the middle node of path 0–1–2 after one propagation step, if node 0 is class 0 and node 2 class 1?
0.5.
Problem 11Level 2
Fraction of greedy (exploiting) choices with ε = 0.1?
0.9.
Problem 12Level 2
Assumption that points in the same cluster share a label?
The cluster assumption.
Problem 13Level 2
Discount factor γ for which a reward 1 step ahead is worth 0.95?
0.95.
Level 3
Problem 14Level 3
Explain why k-means fails on the two-moons data.
k-means assigns each point to the nearest centre, so its clusters are convex (Voronoi cells); interleaved crescents cannot be separated by such cells, so each cluster mixes parts of both moons whatever the labels. ∎
Problem 15Level 3
Explain how self-training can make a model worse.
It labels unlabeled points with its own predictions and retrains on them; if early predictions are wrong in a systematic way (assumption mismatch), those errors are added as training data and reinforced, moving the model further from the truth. ∎
Problem 16Level 3
Contrast self-supervised and unsupervised learning.
Both use unlabeled data. Self-supervised learning turns the data into a supervised pretext problem (predict masked or future parts, match augmented views) and learns a representation for later tasks; unsupervised learning models structure directly (clusters, densities, low-dimensional embeddings). ∎
Problem 17Level 3
Recommend a paradigm for detecting new kinds of faults in satellite telemetry.
Unsupervised (or self-supervised) anomaly detection: model normal behaviour from abundant unlabeled telemetry and flag deviations, since labeled examples of unseen faults do not exist; add semi-supervised refinement as operators label alerts. ∎
Level 4
Problem 18Level 4
Label-propagation accuracy on moons with one label per class in exercise 2?
≈ 0.963.
Problem 19Level 4
Self-training accuracy on blobs with one label per class?
≈ 0.974.
Problem 20Level 4
Nearest-centroid accuracy on moons with 50 labels per class?
≈ 0.79: the convex assumption caps it.
Coding practice
🐍 Code 1 (Level 1): nearest centroid
Supervised classification by class averages.
🐍 Code 2 (Level 1): scoring clusters
Majority mapping accuracy.
🐍 Code 3 (Level 1): learning from rewards
Running mean update.
🐍 Code 4 (Level 1): a pretext task
Hide a column, predict it.
🐍 Code 5 (Level 2): label propagation step
Average neighbours, clamp labels.
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
Types of Learning: Supervised, Unsupervised, Semi-Supervised, Self-Supervised and Reinforcement: topic test
10 questions, drawn at random from a bank of 16. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.