The one idea: Hierarchical clustering never asks you for a number of groups up front — it merges the two most similar clusters, over and over, from every point alone down to one giant cluster, and records the whole merge history as a tree (a dendrogram). You choose how many groups you want after seeing the tree, by picking a height to cut it at, and the tree itself often tells you more than any single cut does.
⚠️ The trap: Any of the four standard linkage methods should give roughly the same clusters — they're all measuring how similar two clusters are. That feels right and it's wrong. Single linkage merges clusters based on their single closest pair of points, so one thin bridge of in-between customers can chain two genuinely separate populations into one cluster — on a test dataset with two dense groups connected by 15 straggler points, single linkage put 54 of 55 points in one cluster and left 1 alone, while complete, average, and ward linkage all split it roughly 26/29 as the data actually looks. Which linkage method you pick changes the answer more than almost any other choice in the analysis.
Think of a company org chart. Individual employees roll up into teams, teams roll up into departments, departments roll up into divisions, divisions roll up into the whole company. Nobody had to decide in advance "we want exactly 6 departments" — the structure exists at every level simultaneously, and you can look at the chart at whatever level of detail answers your current question. Hierarchical clustering builds exactly that structure from data with no natural org chart:…
Keep reading: Hierarchical Clustering
Unlock the full Machine Learning track — every lesson, the AI tutor, and full mock assessments.
- Full lesson content
- AI tutor for this section
- Practice questions