What is the difference between supervised and unsupervised learning?
Machine learning basics · Beginner 1
Short answer
Supervised learning trains on examples with known answers, such as emails labelled spam or not, and learns to predict the label. Unsupervised learning has no labels and finds structure on its own, such as grouping customers into segments. Language model pre-training is often called self-supervised: the next word is the label.
Deeper answer
In supervised learning you have input and output pairs and measure success by comparing predictions with the true outputs, for example classification and regression. In unsupervised learning you only have inputs and look for patterns: clustering, dimensionality reduction, anomaly detection.
Self-supervised learning sits between them: the labels come from the data itself. Predicting the next token in text needs no human labelling, which is why models can train on enormous corpora. Fine-tuning a model on labelled examples is then supervised again.
What a strong answer covers
- Supervised learns from labelled examples
- Unsupervised finds structure without labels
- Gives an example of each
- LLM pre-training is self-supervised
Answer it out loud in the mock interview about 1 min
Follow-ups to expect
- Where does reinforcement learning fit?
- Why is next-token prediction called self-supervised?
Common mistakes
- Saying unsupervised means no data is needed
- Mixing up clustering and classification
Learn it
- How would you tell whether a new model really performs better in an A/B test?
- Explain the bias-variance trade-off.
- What is the difference between a random forest and gradient boosting?
- How does k-means work, and how do you choose k?
- What is data leakage, and how do you prevent it?
- Give an example of feature engineering that made a model better.
- How do you know whether you have enough training data?
- How do you handle a heavily imbalanced classification problem, such as fraud detection?
- What is the difference between linear and logistic regression?
- How do you deal with missing values in a dataset?
- Walk me through an ML project you did, end to end.
- What is overfitting, and how do you spot it?
- Explain precision and recall with an example.
- What do L1 and L2 regularisation do?
- Why do we split data into training, validation and test sets?
- What is the difference between training and inference?