Hierarchical Clustering
Study guides: Exam SRM, Exam PA, Exam MAS-II, Exam ACIA-CAPSTONE
Hierarchical Clustering is a clustering method that builds a nested sequence of clusters, recorded as a dendrogram, without choosing the number of clusters in advance. Agglomerative, or bottom-up, hierarchical clustering runs as follows:
- Start with each of the
nobservations as its own cluster, and compute the dissimilarity of every pair of observations. - Fuse the two clusters that are least dissimilar. The height of the fusion in the dendrogram is their dissimilarity.
- Compute the dissimilarity between the new cluster and each other cluster, using the linkage.
- Repeat steps 2 and 3 until all the observations are in one cluster.
Each fusion reduces the number of clusters by one. A divisive, or top-down, version starts from one cluster and splits one cluster in two at each step. Both give nested clusters with a parent-child structure.
Four territories have dissimilarities
d_ = 2,d_ = 6,d_ = 10,d_ = 5,d_ = 9andd_ = 4. What does agglomerative clustering with complete linkage do?
- The smallest dissimilarity is
d_{12} = 2, so\{1, 2\}fuse at height 2.- Under complete linkage
\{1, 2\}is\max(6, 5) = 6from territory 3 and\max(10, 9) = 10from territory 4.- The smallest is now
d_{34} = 4, so\{3, 4\}fuse at height 4.- The two clusters are
\max(6, 10, 5, 9) = 10apart, so they fuse at height 10.- Cutting between heights 4 and 10 gives the clusters
\{1, 2\}and\{3, 4\}.
Properties of hierarchical clustering
Hierarchical clustering has no random start. Given the data, the dissimilarity measure and the linkage, it always gives the same dendrogram. It is run once, and any number of clusters is obtained by cutting the dendrogram at the right height, without running it again. It stores every pairwise dissimilarity, so it needs memory in proportion to n^2 and does not scale to very large data sets as K-means does.
The nesting is an assumption. If the best two clusters and the best three clusters are not nested, cutting the dendrogram gives worse clusters than K-means, which finds the clusters afresh for each K.
A group of people splits best into two clusters by sex and into three clusters by nationality. Why can hierarchical clustering do worse here than K-means?
- The three nationality clusters are not obtained by splitting one of the two sex clusters.
- Hierarchical clustering forces the three-cluster solution to nest inside the two-cluster one, so it cannot find the nationality clusters.
- K-means with
K = 3starts afresh and is not tied to the two-cluster solution.
Practice questions
- CAS Exam 8 Fall 2016, Question 2
- CAS Exam MAS-II Fall 2018, Question 42
- CAS Exam MAS-II Fall 2019, Question 42
- Exam PA Practice Question 18
- SOA Exam SRM Sample Question 1
- SOA Exam SRM Sample Question 2
- SOA Exam SRM Sample Question 16
- SOA Exam SRM Sample Question 34
- SOA Exam SRM Sample Question 36
- SOA Exam SRM Sample Question 40