Unit content
Hierarchical clustering and dendrograms
Hierarchical clustering represents nested groupings rather than committing immediately to one fixed number of clusters.
In agglomerative clustering, begin with every example in its own cluster. Repeatedly merge the pair of clusters judged closest until one cluster remains. The sequence of merges forms a dendrogram.
The meaning of “closest clusters” depends on the linkage rule. For clusters $A$ and $B$:
- single linkage uses the smallest pairwise distance;
- complete linkage uses the largest;
- average linkage averages pairwise distances.
Suppose points lie at $1,2,8,9$. The nearest pairs $(1,2)$ and $(8,9)$ merge first. Cutting the dendrogram before those two groups merge gives two clusters; cutting higher gives one.
Different linkage choices encode different geometric preferences. Single linkage can join long chains through nearby points, while complete linkage tends to favor compact groups.
A dendrogram is therefore more informative than a single partition: it shows how cluster structure changes across scales. But the result still depends on the chosen distance, linkage and feature representation.