Dendrograms and Reading Cluster Trees
Agglomerative clustering moves from many small clusters, one per point, toward one final grouping. The points themselves never change. Only the grouping changes.
One Grouping Is Not the Whole Story
Most introductions to clustering ask you to pick one grouping of your data. Hierarchical clustering asks a different question: what happens if we watch the grouping form, one step at a time, and keep every stage of that process? Instead of producing a single answer, it produces a family of answers. Each one is a valid grouping of the same points, but each has a different number of clusters.
What do you think happens?
You have five points and run agglomerative clustering. Before any merging has happened, how many clusters are there?
Reveal answer
5
Agglomerative clustering begins with every data point as its own one-point cluster. So at the start, the number of clusters equals the number of points.
How Agglomerative Clustering Starts
Agglomerative clustering is the method that produces a hierarchical clustering. Its defining feature is the direction of its journey. It does not start from a few large groups and split them apart. It starts from the other end: every data point begins as its own one-point cluster.
The source describes the whole procedure as iterative. Each point makes a journey from being a single-point cluster to belonging to some final cluster. Notice what this says about the start and the end. At the start, the number of clusters equals the number of points. At the end, every point belongs to one of the final clusters. Everything in between is the process of points being gathered together.
Agglomerative clustering moves from many small clusters, one per point, toward one final grouping. The points themselves never change. Only the grouping changes.
Watching the Clusters Merge
Each intermediate step of the process is itself a clustering of the data. The steps differ only in how many clusters they contain. Early steps have many small clusters, and later steps have fewer and larger ones. Because every stage is a complete clustering, you do not have to commit to one stage in advance. You can look at the whole sequence and decide which level of grouping is useful for your purpose.
Tracing Five Points Through Each Stage
A concrete trace makes the iterative idea easier to see. Take five points, numbered 1 to 5. The source's teaching example follows the same pattern: points 1 and 2 join first, point 3 later joins them, and points 4 and 5 form their own pair. Follow how the number of clusters drops with each stage, and notice that every point is present in every stage.
Five points through successive clusterings
Points 1 to 5 start as single-point clusters. Trace the clustering stage by stage and record how many clusters remain after each stage.
- 1Stage 0, the start
Each point is its own cluster: {1}, {2}, {3}, {4}, {5}. That is 5 clusters, one per point.
- 2Stage 1, first merge
Points 1 and 2 join: {1,2}, {3}, {4}, {5}. The number of clusters drops from 5 to 4.
- 3Stage 2, second merge
Point 3 joins the group: {1,2,3}, {4}, {5}. The number of clusters drops from 4 to 3.
- 4Stage 3, third merge
Points 4 and 5 form their own pair: {1,2,3}, {4,5}. The number of clusters drops from 3 to 2.
- 5Stage 4, final merge
The two remaining clusters combine into one: {1,2,3,4,5}. The number of clusters is now 1, and every point belongs to this final cluster.
The cluster count falls 5, 4, 3, 2, 1 across the five stages. Each stage is a complete clustering of the same five points, and no point is dropped or duplicated.
Reading the Cluster Tree
The stages are linked. The clusters at one level are built from the clusters at the level before, and a cluster that appears in a later stage is made from clusters that existed earlier. This linking is what makes the result a hierarchy rather than a list of unrelated groupings.
A tree diagram shows that structure. The bottom row holds the individual points, and each line of merging moves upward until everything sits in one final cluster. Read the diagram from the bottom up. Points 1 and 2 join first, point 3 later joins them, and points 4 and 5 form their own pair. The top node is the stage where everything has merged. This diagram is a small teaching illustration. It follows the same pattern the source describes, in which every stage in between is a valid clustering.
Overlaying Every Clustering at Once
Because each stage is a valid clustering, it is sometimes useful to look at all of them on one picture. The source does this with an overlay: it draws every clustering from the run together. The lines in the picture show the cluster assignments, and the data points are numbered so you can follow any one point through the stages. The overlay shows how each cluster breaks up into smaller clusters, which is exactly what a hierarchy is meant to reveal.
The source produces this picture with a helper plotting function from the mglearn package, which the course text uses for its illustrations. That call is a plotting call, not a clustering call on your own data. Treat it as a way to view the structure, not as the algorithm itself.
When you read an overlay, ask which lines stay together as you move from one stage to the next. A group of points that stays linked across several stages is a stable part of the structure. A group that splits apart quickly was gathered only at a fine level of detail.
Mistakes When Reading a Cluster Tree
Common mistake Treating the tree as one answer that the algorithm has already chosen
What it looks likeLooking at the top of the tree and concluding that five points are truly one group.
Why it failsThe top node is only the final stage. Every stage below it is also a valid clustering, and the overlay does not say which stage is correct.
Do this insteadLook across the stages and decide which level of grouping suits your purpose.
Common mistake Assuming a group that splits quickly is meaningless
What it looks likeSeeing a cluster break apart in the next stage and dismissing it.
Why it failsA group that splits apart quickly was gathered only at a fine level of detail. That is information, not an error.
Do this insteadNote at which stage the group splits, and ask whether that level of detail matters for your question.
Common mistake Reading the points themselves as changing between stages
What it looks likeBelieving point 3 moves or disappears when it joins points 1 and 2.
Why it failsThe points never change. Only the grouping changes, and no point is dropped or duplicated.
Do this insteadFollow each numbered point through the stages and watch only its group membership.
Common mistake Forgetting that the number of clusters drops at every merge, so a stage with many clusters is an early stage, not a final result
| Feature of the tree | What it tells you | Caution |
|---|---|---|
| Which points join a cluster | Membership at the stage where the merge happens | Membership is what the stages define, so read it stage by stage |
| How many clusters exist at a stage | The count drops by one at each merge | The count alone does not say which grouping is correct |
| A group that stays linked across stages | A stable part of the structure | Stability is judged across stages, not in a single one |
| A group that splits apart quickly | It was gathered only at a fine level of detail | Do not dismiss it as meaningless |
| The overall picture of nesting | Each smaller cluster belongs to a larger one | The source's point is the nesting, so read nesting, not single snapshots |
Features of a cluster tree and what each one means
Practice Tracing Your Own Stages
Four points, numbered 1 to 4, are clustered agglomeratively. Stage 1 merges points 1 and 2. Stage 2 merges points 3 and 4. Stage 3 merges the two pairs into one cluster. Write the cluster count at each stage, starting from the beginning, and state which points form each cluster after Stage 2.
Hints
- At the start, every point is its own cluster, so the count equals the number of points.
- Each merge combines two clusters into one, so the count drops by one per merge.
- After Stage 2 there are two pairs: one pair from Stage 1 and one from Stage 2.
Key Takeaways
- Agglomerative clustering starts with every point as its own one-point cluster and merges clusters step by step until one final grouping remains.
- Each stage is a complete clustering of the same points, and the number of clusters drops with each merge.
- Later clusters are built from earlier ones, so the stages form a hierarchy that can be read as a tree from the bottom up.
- An overlay of all stages shows how each cluster breaks into smaller clusters, but it does not by itself say which stage is correct.
- Watch which groups stay linked across stages, and avoid reading the top node as the only valid answer.