Supervised Learning
What is Supervised Learning?
Imagine a student, and his teacher gives him lots of math problems with their answers. The teacher says: “Practice with these! If you learn well, you’ll be able to solve new problems all by yourself!”
That’s what Supervised Learning is.
The student = the computer (or AI).
The teacher = the dataset (examples with correct answers).
The math problems with answers = training data.
Simple Definition:
Supervised Learning is when a computer learns from examples that already have the right answers. Then, it uses that learning to solve new problems by itself.
Example 1: Learning Fruits by Size and Color
Let’s say a teacher teaching a robot to recognize fruits.
Teacher gives a table like this:
Color | Size | Fruit |
---|---|---|
Red | Big | Apple |
Yellow | Long | Banana |
Green | Small | Grape |
Here, “Color” and “Size” are like the clues (input), and “Fruit” is the answer (output).
After seeing many such examples, the robot learns:
- Red + Big = Apple
- Yellow + Long = Banana
Now, when teacher shows it Green + Small, it says: “That must be a Grape!”
Example 2: Game Score Prediction
Let’s say someone is playing a video game and the record chart is:
Time Played (mins) | Enemies Defeated | Score |
---|---|---|
10 | 5 | 200 |
20 | 10 | 400 |
15 | 7 | 300 |
The computer learns the pattern: more time and more enemies = higher score.
Now, if he plays for 18 minutes and defeat 8 enemies, the computer guesses your score!
Example 3: Pet Recognition (Images)
The computer is shown :
- Lots of pictures of cats labeled “Cat”
- Lots of pictures of dogs labeled “Dog”
Then, when given it a new picture (without label), it says:
“Hmm… I think it’s a Cat!”
Supervised Learning – Supervised Learning with Simple Python