Introduction to AI Lesson 16 of 25

Part 2 · Lesson 6 · 5 min

Unsupervised learning: finding groups without answers

If you tipped a bag of mixed sweets on the table, could you sort them without anyone telling you the categories?

Of course you could. So can a machine, and that is a whole kind of learning.

In the last lesson the machine had an answer key: every example came with the right label. Most of the data in the world has no labels at all. Nobody has marked which customers are alike or which payments are strange.

Unsupervised learning finds structure in data with no answers attached. Think of sorting a pile of unlabeled laundry: you group by colour or size without knowing whose clothes they are.

Sorting a pile with no labels

The machine grouped things that look alike. It has no idea what the groups are. Naming them, and deciding whether they matter, is still a human job.

Finding the strange one

The same trick works the other way round. Once a machine knows what "normal" looks like, it can point at anything that does not fit. This is called anomaly detection.

Spotting the odd one out

Unusual is not the same as wrong. The flag is a reason to look closer, not a verdict.

Groups can be useless

There are many ways to split any pile of data. The machine will happily find one, whether or not it helps you.

Real groups, useless groups

So "unsupervised" does not mean "no humans". People choose the data, check the groups and decide what they mean.

Go deeper optional

The best-known grouping method is k-means clustering. Picture dots on a page. You pick how many groups you want, say 3, and drop 3 pins at random.

Each dot joins its nearest pin. Then each pin moves to the middle of its dots. Repeat until the pins stop moving. That is the whole idea.

Anomaly detection works from the same picture: a dot that sits far away from every group is the odd one out.

Check yourself

1. What does unsupervised learning work with?

2. A clustering model splits customers into five groups. What should happen next?

3. An anomaly detector flags a payment as unusual. What does that mean?