Types of Machine Learning
Imagine three very different classrooms.
In Classroom A, the teacher holds up a flashcard with a picture and says, "This is a cat." Then another: "This is a dog." The students learn by seeing examples with answers. After enough flashcards, they can identify new animals on their own.
In Classroom B, there's no teacher. Instead, the students get a big pile of photos and are told: "Sort these into groups that make sense." Nobody tells them what the groups should be β the students discover the patterns on their own.
In Classroom C, a student is learning to ride a bike. Nobody gives them a manual. They just try, wobble, fall, adjust, try again. Every time they stay balanced a little longer, they get a "Nice!" They learn by trial, error, and reward.
These three classrooms map exactly to the three main types of machine learning.
1. Supervised Learning β "Learn from the answer key"
This is the most common type. You give the model input-output pairs β data where you already know the correct answer. The model learns to map inputs to outputs.
Think of it like studying with a textbook that has the answers in the back. You practice, check your answer, and adjust.
Examples in the real world:
- Email β spam or not spam? (classification)
- House features β predicted price? (regression)
- Medical scan β disease or healthy? (classification)
- Customer data β will they buy? (classification)
The key requirement: You need labeled data β someone (usually a human) has to provide the correct answers for the training examples.
Supervised Learning: Predict House Prices
2. Unsupervised Learning β "Find the hidden groups"
Here, there are no labels. The model gets raw data and has to find structure on its own. It's like giving someone a box of 1,000 buttons and saying, "Organize these however makes sense to you."
The model might group them by color, size, number of holes, or material β it discovers patterns that aren't obvious to humans.
Examples in the real world:
- Group customers into segments for marketing (clustering)
- Detect unusual credit card transactions (anomaly detection)
- Reduce complex data to its key dimensions (dimensionality reduction)
- Find related products ("customers who bought X also bought Y")
Unsupervised Learning: Customer Clustering
3. Reinforcement Learning β "Learn by doing"
This one's different. There's no dataset at all. Instead, an agent interacts with an environment, takes actions, and receives rewards or penalties. Over thousands of attempts, it figures out the best strategy.
It's exactly like learning to play a video game. Nobody hands you a dataset of "correct moves." You just play, die, learn what killed you, and try a different approach next time.
Examples in the real world:
- Game AI (AlphaGo, Chess engines, Atari bots)
- Self-driving cars (navigate without crashing = reward)
- Robot arms learning to pick up objects
- Recommendation systems (show content β user clicks = reward)
Reinforcement Learning: Simple Reward Agent
Quick check
Continue reading