Definition
Can a shop group its customers without knowing anything about them?
Unsupervised learning is machine learning from data that has no labels. Instead of predicting answers, the model finds structure in the data by itself, such as groups of similar items, a task called clustering.
In simple words
Pour a box of mixed buttons on a table and sort them into piles by colour and size. Nobody told you the piles; you found them. In the activity, the computer does this with shop customers: it notices that some visit often and spend little, others rarely visit but spend a lot, and groups them.
Why it matters
Labels are expensive: someone has to write the right answer for every example. Unsupervised learning finds patterns without them. Shops use it to understand customers, music apps to group similar songs, and banks to spot unusual activity.
Key terms
- Unsupervised learning
- Learning from data that has no labels, by finding structure in it.
- Clustering
- Grouping examples so that those in the same group are more alike than those in different groups.
- Cluster
- One of the groups found by clustering.
- Similarity
- A measure of how alike two examples are.
- Anomaly
- An example that is very different from the rest and fits no group.
Explained in detail
Learning without an answer key
Suppose someone empties a box of mixed buttons on a table and asks you to sort them. Nobody tells you the groups. You look for yourself and decide: by colour, perhaps, or by size, or by the number of holes. You have found structure in the data without being given any answers. Unsupervised learning asks a machine to do the same. It receives examples with no labels and looks for patterns: which items are alike, which are different, and which stand apart from everything else.
Clustering: finding groups
The most common unsupervised task is clustering. The machine measures how similar the examples are to each other and gathers the similar ones into clusters. A supermarket might cluster its customers by what they buy and discover a group who shop for baby products, a group who buy in bulk once a month, and a group who visit daily for fresh vegetables. Nobody defined these groups in advance. They emerged from the shopping data, and the shop can now serve each one better.
The machine finds the groups but does not name them. It reports "cluster 1, cluster 2, cluster 3". A person must look at what is inside each and decide what it means. People also choose how many clusters to look for and which features to compare, and different choices give different groupings. Sorting buttons by colour and sorting them by size are both correct; which is useful depends on what you want to do.
Other unsupervised tasks
- Finding anomalies: spotting the example that fits no group, such as one very unusual payment among millions of ordinary ones.
- Finding things that go together: discovering that people who buy bread often buy butter, which shops use to arrange shelves and suggest items.
- Simplifying data: reducing hundreds of measurements to the few that carry most of the information, so that it can be drawn on a chart.
- Grouping documents: gathering thousands of news articles into topics without anyone reading them first.
Why it matters, and why it is hard
Most of the world's data has no labels, and adding them is expensive. Unsupervised learning can use all of that unlabelled data. It is especially valuable for exploring: when you do not yet know what questions to ask, clustering can show you what kinds of things are in your data. The difficulty is that there is no answer key to check against. With supervised learning you can count right and wrong answers. With clustering you can only ask whether the groups are useful and make sense, and that needs human judgement.
A third way that sits in between
The large language models behind chatbots are trained in a way that needs no human labels, yet still has right answers. The system takes a sentence from a book or a website, hides the next word, and asks the model to predict it. The hidden word is the correct answer, and it came free with the text. This is called self-supervised learning, because the data supplies its own labels. It allowed models to learn from far more text than people could ever label by hand.
How it works
- Decide how many groups to look for.
- Place a centre for each group.
- Each item joins the nearest centre.
- Each centre moves to the middle of its items.
- Repeat until nothing changes. The groups are found.
Try it yourself
Group mystery customers by similarity
Choose how many groups, place the centres, then step through the rounds until the groups settle.
Common mistakes
- Expecting the computer to name the groups. People interpret them.
- Thinking there is one correct number of groups. Different choices show different patterns.
- Mixing it up with supervised learning. No labels are given here.
Check yourself
Summary
- Unsupervised learning finds patterns in data with no labels.
- Clustering groups similar items together.
- People interpret what the groups mean.
Finished reading?