Hierarchical Clustering
Grouping data by building a tree of nested clusters — no need to pick the number of clusters in advance, and you get the whole family structure, not just a flat grouping.
When not to use it
- On large datasets — its O(n²)+ cost doesn't scale; use k-means or mini-batch methods.
- When you already know K and just need a fast flat clustering — k-means is simpler and quicker.
- When clusters are known to be spherical and well-separated — simpler methods suffice.
Reach for something else instead
- K-means for fast, scalable flat clustering when you know (or will search for) K.
- DBSCAN for density-based clusters of arbitrary shape without specifying K.
- Gaussian mixture models for soft, probabilistic cluster assignments.
Sources & further reading
- Ward (1963), Hierarchical Grouping to Optimize an Objective Function — Ward's linkage.
- Hastie, Tibshirani & Friedman, The Elements of Statistical Learning — hierarchical clustering and linkage criteria.
- Müllner (2011), Modern hierarchical, agglomerative clustering algorithms — efficient implementations.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Applying it to large datasets and hitting the quadratic memory wall.
- Ignoring the linkage choice — it materially changes the resulting tree.
- Treating the dendrogram cut height as arbitrary rather than reading it from the data's structure.