Interactive demo · Statistical Methods for Modern Biology · Chapter 5

Hierarchical clustering: linkages, dendrograms and cuts

Agglomerative clustering starts with every observation in its own cluster and repeatedly merges the two closest clusters. What "closest" means for clusters is the linkage: the smallest pairwise distance (single), the largest (complete), the average (average), the increase in the within-cluster sum of squares (Ward) or the distance between centroids. All five are updated by the Lance-Williams recursion, which needs only the old cluster-to-cluster distances. The tree records each merge at its height; cutting it horizontally gives k clusters.

Data

Distance (T-cell data)

Linkage

Cut into k clusters

Merges

Scoreboard

Try these

Ward's method is hclust(method = "ward.D2"): it works on squared distances and reports the square root of twice the increase in the within-cluster sum of squares. Centroid linkage is run on squared Euclidean distances, as hclust expects, and its heights are shown as distances between centroids (square roots). For the T-cell data the right panel shows the distance matrix with rows and columns in the order of the tree's leaves.

In the lecture notes