MACHINE LEARNING • LESSON 2

Unsupervised Learning

Unsupervised Learning is a type of Machine Learning where the model receives data without predefined answers and tries to discover useful patterns or groups by itself.

THE CORE IDEA

There are no correct answers provided to the model.

Instead of telling the model what each example means, we give it data and ask it to find structure, similarities, or patterns inside that data.

01

What Does "Unsupervised" Mean?

In supervised learning, we give the model examples together with known answers.

In unsupervised learning, we do not provide those answers.

The model only receives the data and tries to discover something useful about how the data is organized.

DATA Examples
NO LABELS Find Patterns

This is the key idea you should remember: we do not tell the model what the groups or patterns are beforehand.

02

A Simple Example: Grouping Customers

Imagine that an online store has thousands of customers.

For each customer, the company knows things such as:

  • How much money they spend.
  • How often they purchase.
  • How many products they buy.

But the company has not created any customer groups.

It does not know which customers should belong together.

This is where unsupervised learning can help.

03

Look at the Data

Suppose our dataset looks like this:

Customer Monthly Spending Purchases / Month Products / Purchase
Customer A $900 8 5
Customer B $850 7 5
Customer C $120 2 2
Customer D $100 2 1
Customer E $500 4 3

Notice something important: there is no column saying "Customer Type".

Nobody told the algorithm that Customer A is a "high-value customer" or that Customer C is a "low-value customer."

The model has to discover similarities from the data.

04

The Model Finds Similar Customers

Customers A and B have similar spending and purchasing behavior.

Customers C and D also have similar behavior.

The algorithm can therefore place similar customers into the same groups.

GROUP 1 Customers A + B

Higher spending and frequent purchases.

GROUP 2 Customers C + D

Lower spending and fewer purchases.

The important part is that we did not create these groups manually.

The algorithm discovered them based on similarities in the data.

05

What Is the Model Actually Learning?

The model is looking for structure in the data.

For example, it may notice that some customers have:

  • Similar spending amounts.
  • Similar purchase frequency.
  • Similar purchasing behavior.

It uses those similarities to organize the data into meaningful groups.

Important:

The algorithm discovers patterns, but that does not automatically mean the discovered groups have business meaning. A human still needs to inspect the results and decide what the groups represent.

06

Supervised vs Unsupervised Learning

This is one of the most important differences to understand.

SUPERVISED Known Answers

We provide examples with labels and the model learns to predict those labels.

Example: Predict whether an email is spam.

UNSUPERVISED No Known Answers

We provide data without labels and the model searches for patterns or groups.

Example: Discover groups of similar customers.

The easiest question to ask:

"Do I already know the correct answer for each training example?"

If yes → supervised learning.

If no, and the goal is to discover structure → unsupervised learning may be appropriate.

07

A Second Example: Finding Similar Products

Imagine an online store has thousands of products.

Each product has information such as price, category, size, weight, and purchasing behavior.

But the store does not have predefined groups such as "budget products", "premium products", or "frequently purchased products."

An unsupervised learning algorithm can look at the product data and find products that behave similarly.

PRODUCT DATA Price + Size + Category + Sales
DISCOVERED STRUCTURE Similar Product Groups

Again, we did not provide the correct group for each product. The algorithm discovers similarities from the available data.

08

Clustering Is a Common Unsupervised Learning Task

One of the most common uses of unsupervised learning is clustering.

Clustering means organizing data points into groups based on similarity.

BEFORE Unorganized Data

Many data points with no predefined groups.

CLUSTERING Find Similarities

Similar data points are grouped together.

AFTER Discovered Groups

Data is organized into meaningful clusters.

We will study clustering and the K-Means algorithm in much more detail later in the course.

09

What Unsupervised Learning Does Not Mean

A common misunderstanding is that unsupervised learning means the computer understands everything by itself.

That is not true.

We still need to decide:

  • What data should be used.
  • Which features should be included.
  • What problem we are trying to solve.
  • How to interpret the patterns the model discovers.
The model discovers patterns — it does not decide what those patterns mean for the business.

For example, a clustering algorithm might create three customer groups. A human still needs to examine those groups and decide how they should be used.

10

Unsupervised Learning in One Picture

INPUT Data Without Labels
MODEL Finds Similarities
RESULT Patterns or Groups
KEY IDEA

Unsupervised Learning Finds Structure Without Known Answers.

We provide data without predefined labels. The model looks for similarities, relationships, or groups within that data. Clustering is one of the most common examples of this approach.

QUICK CHECK

Can You Identify Unsupervised Learning?

A supermarket has thousands of customers. It knows how often each customer shops and how much they spend, but it has no predefined customer categories.

The supermarket wants to discover groups of customers with similar shopping behavior.

Answer

This is an unsupervised learning problem.

There are no predefined customer labels. The goal is to discover groups based on similarities in customer behavior.

A clustering algorithm could be used for this task.

NEXT TOPIC

Reinforcement Learning

Supervised learning learns from known answers and unsupervised learning discovers patterns. Next, we will look at a different approach where an agent learns by taking actions and receiving rewards or penalties.