Supervised, unsupervised, and reinforcement learning — when to use each.
Published March 5, 2025
The algorithm learns from labelled training data — each example has an input and a known correct output.
Classification — predict a category:
Regression — predict a number:
Common algorithms: Linear Regression, Logistic Regression, Decision Trees, Random Forests, SVMs, Neural Networks
The algorithm finds patterns in unlabelled data — no correct answers provided.
Clustering — group similar items:
Dimensionality reduction — compress data while keeping structure:
Common algorithms: K-Means, DBSCAN, PCA, Autoencoders
An agent learns by interacting with an environment — receives rewards for good actions and penalties for bad ones.
Key concepts: policy, reward function, Q-learning, PPO
Modern LLMs are trained with a self-supervised objective: predict the next token in a sequence. No manual labels needed — the data labels itself.
Input: "The quick brown fox jumps"
Target: "over the lazy dog"
This lets models train on internet-scale data without expensive human labelling.
| Type | Labelled data? | Example use case |
|---|---|---|
| Supervised | Yes | Spam filter, fraud detection |
| Unsupervised | No | Customer segmentation |
| Reinforcement | Reward signal | Game playing, robotics |
| Self-supervised | Self-generated | LLMs (GPT, Claude) |
For product/backend engineer interviews, you're expected to know these distinctions conceptually — not to implement them. The practical question is: "What type of ML problem is this?" Being able to frame a business problem as supervised/unsupervised demonstrates ML fluency.