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.
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.
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.
This is the key idea you should remember: we do not tell the model what the groups or patterns are beforehand.
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.
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.
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.
Higher spending and frequent purchases.
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.
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.
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.
Supervised vs Unsupervised Learning
This is one of the most important differences to understand.
We provide examples with labels and the model learns to predict those labels.
Example: Predict whether an email is spam.
We provide data without labels and the model searches for patterns or groups.
Example: Discover groups of similar customers.
"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.
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.
Again, we did not provide the correct group for each product. The algorithm discovers similarities from the available data.
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.
Many data points with no predefined groups.
Similar data points are grouped together.
Data is organized into meaningful clusters.
We will study clustering and the K-Means algorithm in much more detail later in the course.
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.
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.
Unsupervised Learning in One Picture
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.
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.
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.