Types of Machine Learning
There are three families: supervised, unsupervised and reinforcement learning.
What you will learn
- Name the three types of ML
- Match a real task to the right type
- Know which type this course focuses on
Three families of learning
Almost every ML task fits into one of three families. They differ by what you give the computer to learn from.
| Type | You give it | It learns to | Example |
|---|---|---|---|
| Supervised | Examples with answers (labels) | Predict the answer for new data | Spam / not-spam, house prices |
| Unsupervised | Data with no answers | Find natural groups or structure | Group customers by behaviour |
| Reinforcement | A goal plus rewards/penalties | Act to earn the most reward | Game-playing AI, a robot walking |
An analogy that sticks
- Supervised = studying with an answer key. Each example comes with the correct answer, so you learn by checking your guesses.
- Unsupervised = sorting a messy drawer with no instructions. You just group similar things together.
- Reinforcement = learning a video game. Nobody tells you the moves; you try things and learn from the score.
Tagging tasks in code
# Which type fits each task?
tasks = {
'predict house price from size': 'supervised', # has answers (prices)
'group shoppers by what they buy': 'unsupervised', # no answers, find groups
'teach a robot to walk': 'reinforcement', # learns from reward
}
for task, kind in tasks.items():
print(task, '->', kind)Note: Output: predict house price from size -> supervised group shoppers by what they buy -> unsupervised teach a robot to walk -> reinforcement The quick test: do your examples come with the right answers? If yes, it is supervised.
Supervised learning is the most common and the best place to start, so most of this course focuses on it. We will also try unsupervised learning later (clustering). Reinforcement learning is powerful but advanced, so we only describe it here.
Tip: How to choose fast: predicting a known answer? Supervised. Exploring data to find groups? Unsupervised. Learning by trial and error toward a goal? Reinforcement.
Q. You have 10,000 photos each labelled “cat” or “dog” and want to label new photos. Which type is this?
✍️ Practice
- Label each as supervised / unsupervised / reinforcement: predicting tomorrow’s temperature; grouping songs by sound; an AI learning chess.
- Write down one real task from your own life for each of the three types.
🏠 Homework
- Pick one ML type and find two real products that use it. Note what each product does.