Hierarchical Clustering
Hierarchical Clustering — Build a tree of clusters by repeatedly merging the closest pair.
Hierarchical clustering doesn’t need you to pick the number of clusters up front. It merges the two closest points, then the next closest, building a tree (dendrogram) you can cut at any level.
- Clusters at cut: 3
- Cut line
Drag the dashed line up and down the dendrogram — the number of clusters and the point colors update live. On elongated data, single linkage chains distant points into one straggly cluster.
Drag the dashed line up and down the dendrogram — the number of clusters and the point colors update live. On elongated data, single linkage chains distant points into one straggly cluster.
The idea in plain words
Hierarchical clustering doesn’t need you to pick the number of clusters up front. It repeatedly merges the two closest groups — starting from single points — building a tree called a dendrogram. Cut that tree at any height and you get that many clusters.
Drag the cut line and the clusters reorganize live. The linkage rule (how “distance between groups” is defined) matters enormously: single linkage can chain distant points into one straggly cluster, unlike the tighter groups k-means would find.
Now, the math
Each step merges the two clusters with the smallest linkage distance:
- the distance between clusters A and B under the chosen linkage.
- the distance between two individual points.
▸ Show the derivation
The dendrogram’s vertical axis is the merge height. Cutting at height h keeps every merge below h and separates the rest, so lowering the cut yields more, smaller clusters. Single linkage merges on the single closest pair, so a thin bridge of points can fuse two otherwise-distinct clusters — the chaining effect.
Now Break It
Try this: The wrong linkage criterion (single linkage) chains distant points into one straggly cluster.
Control: Linkage method selector (set to single)
Last updated .