Machine learning splits into categories based on what kind of feedback the algorithm learns from — labeled examples, no labels at all, a mix of both, or rewards from an environment.
The Main Categories
| Type | Learns From | Goal | Example |
|---|---|---|---|
| Supervised Learning | Labeled data (input + correct output) | Predict labels for new inputs | Predicting house price from size, location |
| Unsupervised Learning | Unlabeled data | Find structure/patterns | Grouping customers into segments |
| Semi-Supervised Learning | A little labeled + lots of unlabeled data | Predict labels, cheaper to collect | Labeling a few medical scans, using thousands of unlabeled ones |
| Self-Supervised Learning | Unlabeled data, with labels generated automatically from the data itself | Learn general-purpose representations | Predicting a masked word in a sentence |
| Reinforcement Learning | Rewards/penalties from an environment | Learn a sequence of actions (a policy) | A game-playing agent, a robot arm |
Supervised, Visually
# Supervised: X (features) paired with y (the correct answer)
X = [[1200, 3], [800, 2], [1500, 4]] # sq ft, bedrooms
y = [55, 38, 72] # price in lakhs — the "supervision"
# Unsupervised: only X, no y
X_unlabeled = [[1200, 3], [800, 2], [1500, 4]] # find groups/patterns, no target given
How to Pick the Right Type
- Do you have historical correct answers to learn from? → Supervised.
- Do you want to find hidden structure with no target variable? → Unsupervised.
- Do you have a little labeled data and much more unlabeled data? → Semi-supervised.
- Are you training on raw data by predicting parts of it from other parts (no human labels at all)? → Self-supervised — this is how most modern LLMs are pretrained; see Generative AI notes.
- Does an agent take sequential actions in an environment and get delayed rewards? → Reinforcement learning.
Common Mistakes
- Calling clustering "classification" — classification is supervised (labels exist); clustering is unsupervised (no labels).
- Assuming reinforcement learning is needed for any "AI agent" — most business ML problems are supervised, not RL.
Interview Relevance
Q: "How is semi-supervised learning different from self-supervised learning?" Semi-supervised still uses some human-provided labels; self-supervised generates its own "labels" from the structure of the raw data (e.g. hiding a word and predicting it) — no human labeling required.
Practice Question
Classify each as supervised, unsupervised or reinforcement learning: (a) predicting tomorrow's stock price from historical prices, (b) grouping news articles by topic with no topic labels, (c) training a robot to walk by trial and error.