LearnMachine learning
Hierarchical clustering
Join the two closest groups again and again, and grow a family tree of your data.
Drag the dashed line on the tree, or use the slider, to choose how many clusters you get. Click the chart to add points; drag them to move.
How it works
One tree, every clustering.
Hierarchical clustering starts with every point as its own cluster. At each step it joins the two closest clusters, until only one is left. The dendrogram records every merge, and the height of each join is the distance at which it happened.
Cutting the tree at a height gives the clusters, so you can choose how many you want after the work is done. A long stretch of the tree with no joins hints at a natural number of clusters.
How close two groups are depends on the linkage. Single linkage uses their nearest pair of points, so it can follow long, curved shapes, but a few stray points can chain groups together. Complete linkage uses the farthest pair, average linkage all pairs, and Ward keeps the spread inside each cluster small. These three prefer round, compact groups.