Skip to content
← AI Folks Labs

Finding groups nobody labelled

Most machine learning learns from answers somebody wrote down. Clustering has none — just a pile of points and the question “is there structure here?” It is how customer segments, anomaly detectors and half of exploratory analysis begin.

5 min · Beginner · Playable

First, the idea

Two rules, repeated until nothing moves

Drop k markers anywhere. Colour every point by whichever marker is closest. Then move each marker to the middle of its own points. Repeat. That is k-means in full — and it usually settles within a dozen rounds.

No labels anywhere

Nobody has said which group any point belongs to. There is no score to check against.

You choose k

The algorithm cannot decide how many groups exist. That number comes from you, and it changes the answer.

It always converges

And it always produces groups — even in data that has none. Getting an answer is not evidence there was one.

Stage 01

Do it by hand, then let it take over

Drag the crosses where you think the groups are, then press “One step” a few times and watch them correct you — or not. Then change k and see how completely the answer changes on identical data.

Drag any cross to move it yourself0 iterations
4Groups
InfinityTightness

Press “Scatter the centres again” a few times and run it. Different starting positions give different answers on the same data.

Real k-means: assign every point to its nearest centre, move each centre to the average of its points, repeat. Two rules, and it is still the most used clustering algorithm there is.

In plain words

Press “Scatter the centres again” and run it several times. On the same points, different starting positions give different final groups. This is why real implementations run k-means many times over and keep the best — and why a clustering you saw once should never be treated as the truth.

Stage 02

There is no correct k

Watch the tightness number as you raise k. It always improves, all the way to one cluster per point, which is perfectly tight and completely useless. No metric can hand you the answer, because the question “how many kinds of customer are there” is not a mathematical one.

Press “Reveal the real groups”

Four groups made this data, one of them much looser than the others. k-means tends to split the loose one and merge two tight neighbours, because it prefers clusters of similar size and roundness.

The shape assumption is doing work

k-means draws round, similar-sized blobs, because “nearest centre” is a circle. Long thin groups, nested rings and varying densities all defeat it — that is when DBSCAN or hierarchical clustering earn their place.

Scale changes the answer

Distance decides everything, so a feature measured in rupees will overwhelm one measured in years. Forgetting to scale is the most common clustering mistake there is.

Validation is a conversation

You test a clustering by checking it is stable across runs and samples, then by asking a domain expert whether the groups mean anything. There is no accuracy score to hide behind.

What follows from this

What this explains

Why customer segments feel arbitrary

Because to a degree they are. The algorithm found groups that are tight in the space you gave it. Whether those groups deserve names and budgets is a judgement somebody has to make and defend.

Why anomaly detection uses this

A point far from every centre is unusual by definition. No labels needed, which matters enormously when the thing you are hunting is rare and nobody has labelled it.

Why the same idea powers recommendations

Cluster users by behaviour and “people like you” becomes a computation. The map of meaning lab is the same trick applied to words.

Why unsupervised work needs more care, not less

With no accuracy score, nothing stops you presenting nonsense confidently. Stability checks and expert review are the substitute, and they are a discipline rather than a step.

Next

Module III is this, on real customers

Clustering, dimensionality reduction and the segmentation project — including the part where you have to convince somebody the groups are real.