Supervised Learning
What is it?
Supervised learning trains a model on labeled examples — inputs paired with the correct answers — so it learns to predict the answer for new inputs.
Explain like I'm 5
Why was it created?
Many real problems (spam or not, price prediction) have known answers for past data. Supervised learning formalizes using those known answers to learn a predictive rule.
Where is it used?
- Spam detection
- Image classification
- Price and demand prediction
- Sentiment analysis
Why should developers care?
It's the most common and practical form of machine learning, underpinning classification and prediction features across products.
How does it work?
You collect inputs with correct labels, split into training and test sets, and train the model to minimize the gap between its predictions and the labels. You then check accuracy on held-out data it never trained on.
Real-world example
You train on thousands of emails labeled 'spam' or 'not spam'; the model then flags new incoming spam.
Common use cases
- Classification (categories)
- Regression (numeric prediction)
- Ranking
- Fraud and anomaly detection
Advantages
- Clear objective and metrics
- Accurate when labels are good
- Well-understood and tooled
- Broad applicability
Disadvantages
- Needs lots of labeled data
- Labeling is costly and can be biased
- Poor on situations unlike training data
- Can overfit without care
When should you use it?
When you have (or can get) labeled examples and want to predict a known kind of answer.
When should you avoid it?
When labels are unavailable or the goal is to discover structure — use unsupervised learning instead.
Alternatives
Related terms
Interview questions
Beginner
- What makes learning 'supervised'?
- Give an example of a supervised task.
Intermediate
- What is the difference between classification and regression?
- Why hold out a test set?
Senior
- How does label quality/bias affect a supervised model?
- How do you handle limited labeled data?
Common misconceptions
- "Supervised means a human watches training" — it means the data has labels, not live supervision.
- "More data always fixes it" — biased or mislabeled data can cap performance.
Fun facts
- Most classic ML tutorials start with supervised tasks like iris classification.
- Self-supervised learning creates labels from the data itself to sidestep manual labeling.
Timeline
- 1990s — Supervised methods (SVMs, trees) mature
- 2010s — Deep supervised learning dominates vision and speech
Learning resources
Quick summary
Supervised learning trains on labeled input-answer pairs so the model can predict answers for new inputs; it's the most common form of ML.
Cheat sheet
- Learns from labeled examples
- Classification & regression
- Needs quality labeled data
- Test on held-out data