Group learning methods by what feedback is available:
- Known answers: supervised learning.
- No labels: unsupervised or self-supervised objectives, depending on how targets are built.
- Some labels: semi-supervised learning.
- Actions and rewards: reinforcement learning.
The main learning paradigms are:
- Supervised learning: Learn from examples with correct answers.
- Unsupervised learning: Find structure in data without correct answers.
- Semi-supervised learning: Combine a small labeled dataset with a larger unlabeled dataset.
- Self-supervised learning: Create training signals from the data itself.
- Reinforcement learning: Learn actions by trial, error, and reward.
This page focuses mainly on the first three because they are the foundation of most applied ML workflows.
1. Supervised Learning
Supervised learning is used when each training example has an input and a known output.
Example:
- Input: features extracted from an email.
- Label: spam or not spam.
The algorithm learns a mapping from input X to output Y.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Two Main Supervised Tasks
Classification predicts a category.
Examples:
- Is this signal line-of-sight or non-line-of-sight?
- Is this image a cat, dog, or bird?
- Is this transaction fraudulent?
Regression predicts a continuous number.
Examples:
- Predict house price.
- Predict channel gain.
- Predict temperature.
- Predict battery lifetime.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Strengths
- Usually easy to evaluate because correct answers exist.
- Often achieves high accuracy when labels are reliable.
- Many mature algorithms and tools are available.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Limitations
- Labeled data can be expensive.
- Labels may be noisy or subjective.
- The model may fail when the deployment data differs from the training data.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
2. Unsupervised Learning
Unsupervised learning is used when data has no labels. The goal is not to predict a known answer, but to discover structure.
Example:
- Input: customer purchase histories.
- Output: natural customer groups discovered by the algorithm.
Do geometric clusters automatically become meaningful classes?
1. Formula and symbols
- : feature vector
- : centre j
- : assigned cluster
- : examples assigned to j
- : inertia
Alternate assignment and centre averaging
the lab retains an old centre if a cluster is empty.
2. Work with the current inputs
3. Result
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Common Unsupervised Tasks
Clustering: Group similar examples together.
Examples:
- Group wireless users by mobility pattern.
- Group customers by buying behavior.
- Group documents by topic.
Dimensionality reduction: Compress data while preserving important information.
Examples:
- Reduce hundreds of sensor features to two or three visualization axes.
- Remove redundant features before classification.
- Build compact embeddings for images or text.
Anomaly detection: Identify rare or unusual patterns.
Examples:
- Detect abnormal network traffic.
- Identify faulty sensor readings.
- Flag unusual medical measurements.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Strengths
- Useful when labels are unavailable.
- Can reveal hidden patterns.
- Helpful for exploration and visualization.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Limitations
- Evaluation is harder because there is no single correct answer.
- Clusters may not match human categories.
- Results can change depending on scaling, distance metric, and hyperparameters.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
3. Semi-Supervised Learning
- Semi-supervised setting: a small labelled set plus many unlabelled examples.
- Where it helps: wireless measurements, imaging, remote sensing, or speech when careful labels are costly.
How do a few labels spread through unlabelled data?
1. Formula and symbols
- : Similarity edge between points i and j
- : Similarity width (0.2 in normalised units)
- : Diagonal matrix of node degrees, D_ii = Σ_j W_ij
- : Normalised graph
- : Known labels: one-hot rows for labelled points, zeros otherwise
- : Class scores after t spreading steps
- : How much each step trusts neighbours versus the original labels
Each point takes the class with the larger score in F. Grey points have not been reached yet: each iteration moves labels one graph hop.
2. Work with the current inputs
3. Result
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Why It Works
- Unlabelled data: can reveal clusters or other structure.
- Labels: tell the model what some of that structure means.
- Risk: wrong assumptions about unlabelled structure can hurt rather than help.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Common Semi-Supervised Techniques
- Pseudo-labeling: Train a model on labeled data, use it to label unlabeled data, then train again using confident predictions.
- Consistency regularization: Make the model produce similar predictions when the same input is slightly modified.
- Graph-based methods: Treat data points as nodes in a graph and spread labels through nearby points.
- Teacher-student models: A teacher model generates targets for a student model, often with confidence filtering.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
When It Helps
Semi-supervised learning is most useful when:
- Labels are expensive.
- Unlabeled data is abundant.
- The unlabeled data comes from the same distribution as the labeled data.
- The task has natural structure that unlabeled examples can reveal.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
4. Self-Supervised Learning
Self-supervised learning creates labels from the data itself. It is widely used in modern deep learning.
Examples:
- Predict a missing word in a sentence.
- Predict the next frame in a video.
- Learn image representations by matching two augmented views of the same image.
The key idea is that the model learns useful representations before seeing task-specific labels. After that, it can be fine-tuned with fewer labeled examples.
References for this section3
- Scikit-learn documentation, "Supervised learning".
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
5. Reinforcement Learning
Reinforcement learning is different because the model learns by interacting with an environment. It takes actions and receives rewards.
Examples:
- A robot learns to walk.
- A radio controller learns a resource-allocation policy.
- A game-playing agent learns strategies through self-play.
Unlike supervised learning, the agent is not told the correct action at every step. It must discover which actions produce good long-term outcomes.
References for this section3
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
Choosing the Right Paradigm
| Situation | Good starting point |
|---|---|
| You have many labeled examples | Supervised learning |
| You have no labels and want patterns | Unsupervised learning |
| You have few labels and many unlabeled examples | Semi-supervised learning |
| You have huge raw data and want reusable features | Self-supervised learning |
| You need sequential decisions and rewards | Reinforcement learning |
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
- Scikit-learn documentation, "Supervised learning".
Python Examples for Each Paradigm
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Supervised Learning: Classifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42, stratify=y
)
clf = RandomForestClassifier(n_estimators=200, random_state=42)
clf.fit(X_train, y_train)
print(classification_report(y_test, clf.predict(X_test)))
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Supervised Learning: Regressor
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error
X, y = fetch_california_housing(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
reg = RandomForestRegressor(n_estimators=200, random_state=42)
reg.fit(X_train, y_train)
pred = reg.predict(X_test)
print("MAE:", mean_absolute_error(y_test, pred))
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Unsupervised Learning: Clustering
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
X, _ = load_iris(return_X_y=True)
X_scaled = StandardScaler().fit_transform(X)
kmeans = KMeans(n_clusters=3, random_state=42, n_init="auto")
cluster_id = kmeans.fit_predict(X_scaled)
print(cluster_id[:10])
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
Semi-Supervised Learning: Label Spreading
import numpy as np
from sklearn.datasets import load_iris
from sklearn.semi_supervised import LabelSpreading
X, y = load_iris(return_X_y=True)
rng = np.random.default_rng(42)
y_partial = np.full_like(y, fill_value=-1)
labeled_indices = rng.choice(len(y), size=20, replace=False)
y_partial[labeled_indices] = y[labeled_indices]
model = LabelSpreading()
model.fit(X, y_partial)
print(model.transduction_[:10])
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- Scikit-learn documentation, "Supervised learning".
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
Takeaway
- Choose by feedback: labels, no labels, partial labels, or rewards.
- Modern systems: may combine self-supervised pretraining with later supervised or reinforcement-learning stages.
Continue with Parameters, Training and Generalization to build on this note.
References for this section3
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
- Scikit-learn documentation, "Supervised learning".
Check your understanding
0 of 4 answered
A model learns from 500 examples with known numeric targets. Which setting is this?
Four points have squared distances 1, 4, 1 and 2 to their assigned centres. What is K-means inertia?
What does cluster label 2 mean without additional labels?
You have 20 labelled and 980 unlabelled examples from a relevant distribution. Which approach can use both?
Complete references and further reading
- O. Chapelle, B. Scholkopf, and A. Zien, Semi-Supervised Learning, MIT Press, 2006.
- I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016.
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.
- Tpoint Tech/Javatpoint, "Machine Learning Tutorial".
- Scikit-learn documentation, "Supervised learning".