Grouping Problems
Sometimes we have data but do not know the categories beforehand. Instead of telling the model which category each example belongs to, we ask it to discover useful groups in the data.
Find similar examples and group them together.
In a grouping problem, we do not necessarily provide the correct category for every example. The system looks for similarities and differences in the data and creates groups based on those patterns.
Imagine a Store With Many Customers
Suppose an online store has thousands of customers. The business wants to understand what types of customers it has.
But nobody has manually labeled the customers as "frequent buyers", "occasional buyers", or "inactive customers".
We only have customer information such as purchase frequency, spending, and website activity.
- Customer A buys frequently and spends a lot.
- Customer B buys occasionally and spends less.
- Customer C rarely purchases anything.
The Model Looks for Similarity
A grouping algorithm looks at the available information and tries to identify examples that are similar to one another.
Customers with similar behavior may end up in the same group.
Purchase frequency, spending, activity
Compare customers based on their data
Similar customers grouped together
We Don't Give the Categories First
This is the major difference between classification and grouping.
Classification
We already know the categories and provide examples with those categories.
Example: Spam / Not Spam.
Grouping
We do not provide predefined categories. The algorithm discovers groups based on similarities.
Example: discover different customer segments.
Example: Customer Segmentation
Imagine we have customer data containing annual spending and number of purchases.
A grouping algorithm might discover that some customers behave similarly.
- Customers who purchase frequently and spend a lot.
- Customers who purchase occasionally.
- Customers who rarely purchase.
These groups were not necessarily defined manually. They were discovered from patterns in the data.
Another Example: Products
Grouping can also be used to organize products based on their characteristics.
Suppose an online store has thousands of products but the existing categories are incomplete.
A grouping algorithm could find products that have similar characteristics and place them into groups.
Products with similar price ranges, customer behavior, and purchasing patterns may naturally form groups.
Grouping Does Not Automatically Give Meaningful Names
This is an important point for beginners.
If an algorithm creates three groups, it may simply call them Group 1, Group 2, and Group 3.
A human still needs to examine those groups and understand what makes them different.
Humans often need to interpret what those groups actually mean in the real world.
Grouping Is Useful When We Don't Know the Structure
Grouping can be useful when the structure of the data is not obvious.
Instead of manually defining every category first, we allow the algorithm to search for patterns.
This can help us explore a dataset and discover relationships that were not obvious beforehand.
Classification vs Grouping
Classification
- Categories are known.
- Training examples have known labels.
- Model predicts a known category.
Example: classify an email as Spam or Not Spam.
Grouping
- Categories are not known beforehand.
- Examples may not have labels.
- Algorithm discovers groups from patterns.
Example: discover customer segments.
Where Is Grouping Used?
Grouping is useful in many situations where we want to discover natural structure in data.
- Customer segmentation.
- Grouping similar products.
- Discovering similar documents.
- Organizing large collections of data.
Grouping Discovers Structure Instead of Using Predefined Categories
When we do not have predefined labels, a grouping algorithm can look for similarities in the data and organize examples into groups.
Which Approach Would You Use?
Classification.
Grouping may be useful.
Numerical prediction.