Machine Learning

Clustering

Grouping things that resemble each other — and the fact that the algorithm always returns groups, whether or not any exist.

Reading level: Curious
Pick your depth ↓

When not to use it

  • When you already know the categories. That's classification, and it's more accurate and measurable.
  • On high-dimensional data without reduction. Distances concentrate and "similar" stops meaning anything.
  • To justify a decision on its own. A cluster is a hypothesis. Someone has to look at it and vouch for it.

Reach for something else instead

  • Classification when the groups are known and you have labels.
  • Manual segmentation on business rules — often the right answer, and it has the advantage of being explicable.
  • Dimensionality reduction plus looking — sometimes you just want to see the shape of the data, not commit to groups.

Sources & further reading

  • Arthur & Vassilvitskii (2007), k-means++: The Advantages of Careful Seeding — why initialisation matters, and the fix.
  • Ester et al. (1996), A Density-Based Algorithm for Discovering Clusters — DBSCAN, and clusters that aren't blobs.
  • von Luxburg, Williamson & Guyon (2012), Clustering: Science or Art? — the stability and evaluation problem.

Primary sources, listed so you can check the claims on this page rather than take them on trust.

Where people go wrong

  • Trusting k from the elbow method. It's a hint. The right k is the one a domain expert can name.
  • Running k-means once. It converges to local optima; different seeds give different answers, and that variation is information.
  • Clustering unscaled data, then discovering the groups are entirely about revenue because revenue had the biggest numbers.

At a glance

FieldMachine Learning
Core ideagroup by similarity
Defaultk-means, with spherical assumptions
Better for odd shapesDBSCAN
Always returnsgroups, real or not
DifficultyBeginner → Intermediate
Flashcards for this concept
Question
Answer
1 / 4

Often compared with

k-means vs. DBSCAN — forcing every point into a round group vs. finding dense regions and calling the rest noise.