MACHINE LEARNING • LESSON 11

Supervised vs Unsupervised Learning

The biggest difference is simple: supervised learning uses known answers, while unsupervised learning works without known answers.

THE SIMPLE IDEA

Does the training data contain the correct answer?

If the answer is available, we are usually dealing with supervised learning. If there is no predefined answer and the model must discover patterns or groups, we are dealing with unsupervised learning.

01

What Is Supervised Learning?

In supervised learning, we train a model using data that already contains the correct answers.

The model sees examples like:

INPUT FEATURES KNOWN ANSWER
2 hours + 60% attendance Fail
5 hours + 80% attendance Pass
7 hours + 90% attendance Pass

The model learns from these examples and can then predict the answer for new data.

Data + Answers Train Model New Data Prediction
Supervised learning is like learning with a teacher who gives you examples together with the correct answers.
02

Example of Supervised Learning

Suppose an online store wants to predict whether a customer will buy a product.

The company has historical data:

SPENDING VISITS BOUGHT?
₹1,000 2 No
₹5,000 8 Yes
₹8,000 12 Yes

Here, "Bought?" is the known answer. The model can learn from it.

KNOWN LABEL Bought = Yes / No
03

What Is Unsupervised Learning?

In unsupervised learning, we give the model data without predefined answers.

For example, we may have:

CUSTOMER A ₹1,000 / 2 visits
CUSTOMER B ₹1,200 / 3 visits
CUSTOMER C ₹10,000 / 15 visits
CUSTOMER D ₹11,000 / 17 visits

There is no column saying:

Customer A → Group 1
Customer B → Group 1
Customer C → Group 2
Customer D → Group 2

The algorithm has to discover the groups itself.

Data Only Find Patterns Groups
Unsupervised learning is like giving someone a pile of objects and asking them to organize similar objects together without telling them the categories.
04

The Main Difference

The easiest way to remember the difference is to look at whether the data has labels.

SUPERVISED Data + Labels

The correct answer is already known.

Data + Answer → Learn → Predict
UNSUPERVISED Data Only

There is no predefined answer.

Data → Discover → Groups / Patterns
05

A Simple Student Example

Let's use the same student data to see the difference.

Supervised Learning

STUDY HOURS ATTENDANCE RESULT
2 60% Fail
5 80% Pass
7 90% Pass

The model knows the results, so it can learn to predict the result for a new student.

Unsupervised Learning

STUDY HOURS ATTENDANCE RESULT
2 60%
5 80%
7 90%

There is no known result. An unsupervised algorithm might discover groups of students with similar study and attendance patterns.

06

Algorithms You Already Know

Some of the algorithms you've already learned are supervised learning algorithms.

SUPERVISED Linear Regression

Predicts a numerical value.

SUPERVISED Logistic Regression

Predicts classes.

SUPERVISED KNN

Predicts a class using nearby examples.

UNSUPERVISED K-Means

Discovers groups in data.

07

Think of It Like a Teacher

A simple analogy makes this difference easy to remember.

SUPERVISED Teacher Gives Answers

A teacher shows you examples and tells you whether each answer is correct.

Examples + Answers → Learn
UNSUPERVISED No Answers Given

You receive the information and have to find patterns or organize it yourself.

Examples Only → Find Patterns
08

When Do We Use Each One?

USE SUPERVISED LEARNING When you have known answers

Use it when historical data contains the result you want the model to learn to predict.

Example: Predict whether a customer will buy.
USE UNSUPERVISED LEARNING When you want to discover patterns

Use it when you have data but don't already know the natural groups inside it.

Example: Discover different customer segments.
REMEMBER THIS

The question is: "Do we have the answer?"

If we have known labels and want to learn how to predict them, we use supervised learning. If we don't have labels and want the algorithm to discover patterns or groups, we use unsupervised learning.

KNOWN ANSWERS? YES Supervised
OR
KNOWN ANSWERS? NO Unsupervised
QUICK CHECK

Check Your Understanding

What does supervised learning use? Training data with known labels or answers.
What does unsupervised learning use? Data without predefined labels.
Is KNN supervised or unsupervised? Supervised, because it learns from labeled examples.
Is K-Means supervised or unsupervised? Unsupervised, because it discovers clusters without predefined labels.
What does supervised learning usually do? Learns from known answers to make predictions.
What does unsupervised learning usually do? Finds patterns, structures, or groups in data.
NEXT TOPIC

What Is K-Means?

Now that you understand why clustering is unsupervised, we'll look at K-Means, one of the most common algorithms used to create clusters.