🎓 The Three Types of Learning
Supervised, unsupervised, and reinforcement — matched to different problems⏱ ~3 min
Machine learning isn't one method. There are three main styles, and each fits a different kind of problem. Knowing which is which is one of the most useful things a beginner can learn — it shows up in interviews, courses, and every real project.
1. Supervised Learning — Learning With an Answer Key
You give the model labeled examples: input + correct answer. It learns to map inputs to outputs. This is the most common type in practice.
- •Classification — predict a category: spam / not spam, cat / dog, fraud / legitimate
- •Regression — predict a number: house price, tomorrow's temperature, expected sales
- •Needs lots of labeled data, which can be expensive to create (someone has to label it)
2. Unsupervised Learning — Finding Hidden Structure
You give the model data with NO labels and ask it to find patterns or groupings on its own. It doesn't know the 'right answer' — there isn't one.
- •Clustering — group similar things together: customer segments, similar documents
- •Anomaly detection — flag things that don't fit the pattern (hugely important in cybersecurity!)
- •Great when you don't have labels — which is most real-world data
3. Reinforcement Learning — Learning by Trial and Reward
An 'agent' takes actions in an environment and gets rewards or penalties. Over time it learns a strategy that maximizes reward. This is how AI mastered games like Go and how robots learn to walk.
- •No dataset — the agent generates its own experience by trying things
- •Powered breakthroughs like AlphaGo beating the world Go champion in 2016
- •Used in robotics, game AI, and increasingly to fine-tune chatbots (RLHF)
You have network traffic with no labels and want to flag unusual activity. Which learning type?