Hierarchical Clustering › Visualizing Hierarchical Clustering
Machine Learning from ScratchAll chapters Hierarchical Clustering › Visualizing Hierarchical ClusteringOne section · Sections in this chapter3 / 8 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let's create visualizations that demonstrate the key concepts of hierarchical clustering, including how different linkage criteria affect the clustering results and how dendrograms reveal the hierarchical structure.




The visualization above shows several key concepts in hierarchical clustering. The top-left plot shows our original data with three distinct clusters, which is our ground truth. The three dendrograms below show how different linkage criteria create different hierarchical structures.
Notice how the single linkage dendrogram (top-right) merges many points at low distances because one close pair is enough to connect two clusters. The complete linkage dendrogram (bottom-left) uses a stricter farthest-point criterion, so its merge heights are often larger even though the resulting clusters are more compact. The average linkage dendrogram (bottom-right) provides a balanced approach between these two extremes.
The height of the horizontal lines in each dendrogram represents the distance at which clusters were merged. Longer lines indicate that clusters were merged at greater distances, suggesting they were less similar. We can use significant gaps in the merging distances to choose the number of clusters.