Tutorials › Exam PA - Predictive Analytics › Reading Dendrograms And Choosing A Cut

Exam PA · Clustering and Similarity Structure · Tutorial 596 of 966

Reading Dendrograms And Choosing A Cut

Read a hierarchical clustering tree from its leaves and merge heights, and determine how a chosen horizontal cut changes cluster memberships.

Intermediate 11 min read

What You'll Learn

  • Identify what dendrogram leaves, branches, and merge heights represent
  • Trace a valid sequence of merges between existing clusters
  • Find cluster memberships and cluster counts at specified cut heights
  • Compare alternative cuts and describe which observations are grouped together
  • Avoid errors caused by counting leaves or overlooking an earlier merge

Reading a Dendrogram

A dendrogram displays the nested groups created by a hierarchical clustering procedure. Its leaves represent the individual observations being clustered; its branches show how groups combine; and its vertical axis records the height, or dissimilarity value, at which each combination occurs. Reading the tree carefully lets you recover cluster memberships at different stages without rerunning the clustering.

The key is to follow the branches from the leaves upward. A horizontal cut separates the observations into the groups that have joined below the cut but have not yet joined one another above it. Moving the cut higher generally produces fewer groups in a monotone dendrogram. The decision about which cut is useful requires interpretation: the tree describes nested groupings, but does not by itself establish a uniquely correct number of clusters. This skill is aligned with the SOA Exam PA (Predictive Analytics) syllabus.

Definition: In a dendrogram, each leaf represents one observation, and each merge joins two existing groups into a larger group. The merge's vertical coordinate is its height. A horizontal cut at height \(h\) defines clusters by separating the branches at that level: observations connected below the cut belong to the same cluster, while branches separated by the cut belong to different clusters.

In a binary agglomerative tree with \(n\) leaves, each merge reduces the number of separate groups by one. A complete tree therefore contains \(n-1\) merges: it begins with \(n\) singleton groups and ends with one group containing all observations. Each merge must combine groups that already exist. For example, after forming \(\{A,B\}\) and \(\{C,D\}\), the next merge could join those two groups to make \(\{A,B,C,D\}\); it cannot add \(C\) to \(\{A,B\}\) while also leaving \(C\) in \(\{C,D\}\).

Leaf order along the bottom is not usually meaningful by itself. The branches convey the nested memberships; branches can often be flipped left-to-right without changing the clustering. Nor does a branch's visual width or the horizontal distance between leaves generally represent the merge height. Read the value from the vertical axis at the merge.

How to Determine Memberships at a Cut

For a monotone dendrogram, a merge at height less than or equal to \(h\) has occurred by a cut at \(h\); a merge above \(h\) has not. At a height exactly equal to a merge, this tutorial uses the convention that the merge is included. In practice, a cut between two distinct merge heights avoids ambiguity about equality. To identify the groups, start at each leaf and trace its branch upward only as far as the cut. Leaves connected below the cut form one cluster.

1
List the leaves.
Record every observation represented in the tree. These are the starting singleton groups.
2
Trace merges in order.
At each node, combine the two groups whose branches meet. Check that both groups have already been formed or are individual leaves.
3
Locate the cut.
Compare the cut height with each merge height. Include merges below the cut, and exclude merges above it.
4
Report both memberships and count.
Write the observations in each cluster and state the total number of clusters. Check that every leaf appears exactly once.

The count has a useful check. If the tree is monotone and \(m\) merges have occurred by the cut, then the number of remaining clusters is \(n-m\). This follows because there are initially \(n\) singleton groups, and each included merge replaces two groups with one, reducing the count by exactly one. The count check is helpful, but it does not replace tracing the branches: it cannot tell you which observations belong together.

$$ \text{number of clusters at the cut} = n - \text{number of included merges} $$

Worked Cuts

Worked Example: A Five-Leaf Tree at Three Cut Heights

A hypothetical segmentation analysis produces a dendrogram with leaves \(A,B,C,D,E\) and these merges: \(A\) with \(B\) at height \(0.4\); \(C\) with \(D\) at \(0.8\); \(\{A,B\}\) with \(\{C,D\}\) at \(2.5\); and \(\{A,B,C,D\}\) with \(E\) at \(4.0\). Find the memberships at cut heights \(1.0\), \(3.0\), and \(4.5\).

Method. Trace each valid merge from the leaves upward, including it only when its height is at or below the cut.

At height \(1.0\), the merges at \(0.4\) and \(0.8\) have occurred. They create \(\{A,B\}\) and \(\{C,D\}\); the merge at \(2.5\) has not occurred, and \(E\) is still alone. Thus the clusters are \(\{A,B\}\), \(\{C,D\}\), and \(\{E\}\), for a total of three.

At height \(3.0\), the merge at \(2.5\) has also occurred. The first two groups combine into \(\{A,B,C,D\}\), while \(E\) remains separate because the final merge is at \(4.0\). The clusters are \(\{A,B,C,D\}\) and \(\{E\}\), for a total of two.

At height \(4.5\), all four merges have occurred. The single cluster is \(\{A,B,C,D,E\}\).

Check. There are five leaves and four total merges. The counts after zero, two, three, and four merges are respectively five, three, two, and one, matching the memberships above. The merge sequence is valid: every merge joins two groups already available at that stage.

Worked Example: Comparing Nearby Cuts

A hypothetical study groups six service locations. The dendrogram merges \(A\) with \(B\) at \(0.6\), \(C\) with \(D\) at \(1.0\), and \(E\) with \(F\) at \(1.4\). It then merges \(\{A,B\}\) with \(\{C,D\}\) at \(3.0\), followed by \(\{A,B,C,D\}\) with \(\{E,F\}\) at \(4.2\). Compare cuts at \(2.0\), \(3.5\), and \(4.5\).

At \(2.0\), the first three merges have occurred, so the groups are \(\{A,B\}\), \(\{C,D\}\), and \(\{E,F\}\). There are three clusters.

At \(3.5\), the merge at \(3.0\) has occurred, joining the first two groups. The merge at \(4.2\) has not occurred. The groups are \(\{A,B,C,D\}\) and \(\{E,F\}\), so there are two clusters.

At \(4.5\), the final merge has occurred. All six locations belong to \(\{A,B,C,D,E,F\}\), so there is one cluster.

Check. The cuts include three, four, and five merges, respectively. Starting with six singleton groups gives \(6-3=3\), \(6-4=2\), and \(6-5=1\) groups, consistent with the traced memberships.

Worked Example: Using a Large Gap to Compare Cuts

A hypothetical analysis of seven observations has merges \(A\) with \(B\) at \(0.5\), \(C\) with \(D\) at \(0.7\), \(E\) with \(F\) at \(1.1\), \(\{A,B\}\) with \(\{C,D\}\) at \(1.8\), \(\{A,B,C,D\}\) with \(\{E,F\}\) at \(3.6\), and \(\{A,B,C,D,E,F\}\) with \(G\) at \(5.0\). Find the memberships at \(2.5\) and \(4.2\), and describe how the cut changes the grouping.

At \(2.5\), the first four merges have occurred. The first two pairs have combined into \(\{A,B,C,D\}\); \(\{E,F\}\) has formed but has not yet joined that group; and \(G\) is alone. The clusters are \(\{A,B,C,D\}\), \(\{E,F\}\), and \(\{G\}\): three clusters.

At \(4.2\), the merge at \(3.6\) has also occurred, joining the first two clusters from the previous cut. The merge at \(5.0\) has not occurred, so the clusters are \(\{A,B,C,D,E,F\}\) and \(\{G\}\): two clusters.

The cut has crossed a merge at \(3.6\), so it combines the six observations in the first two groups while leaving \(G\) separate. The relatively large gap between the merge heights \(3.6\) and \(5.0\) makes cuts within that interval produce the same two memberships. A gap can suggest a stable range of cuts to examine, but it does not prove that those clusters are substantively meaningful.

Check. Seven leaves and five included merges at \(4.2\) give \(7-5=2\) clusters. Each of \(A\) through \(F\) appears once in the larger group, and \(G\) appears once in the other group.

Choosing and Explaining a Cut

A cut is a way to turn a nested tree into one flat grouping. The vertical axis lets you state where groups combine, and the cut specifies which combinations to retain. A lower cut preserves more, smaller groups; a higher cut combines them into fewer, larger groups. To explain a chosen cut clearly, report the height or interval, the memberships, and the resulting count. If the purpose is to describe groups, also say which observations are kept together or remain separate.

There is not necessarily one best cut for every purpose. A cut may be selected to create a manageable number of groups, to preserve a visually distinct separation in the tree, or to support a later analysis. These are different considerations. The tree alone does not establish that a group is useful, predictive, or meaningful in context. A cluster is a grouping based on the inputs and dissimilarities used to construct the tree, not a discovered outcome label.

A horizontal line between two consecutive merge heights can be especially convenient. Every cut in that interval includes the same merges and therefore produces the same memberships. If two or more merges share a height, a cut exactly at that height can include several joins at once under the convention used here; state the convention or choose a cut just above or below the tied height when the distinction matters.

The cluster-count calculation also has a limitation. The simple rule “leaves minus merges at or below the cut” assumes a monotone dendrogram, where merge heights do not reverse the vertical ordering of earlier and later joins. If a displayed algorithm produces an inversion, do not mechanically count historical merges by their listed heights. Read the branches where the horizontal line intersects them and inspect how the tree represents the groups. The examples here use monotone merge heights.

Common Mistakes and a Reliable Check

A frequent error is to count leaves below the cut instead of groups. Five leaves do not imply five clusters if some of their branches have already joined. The reverse error is to count branch junctions above the cut as if they had already happened. A merge above the line has not joined its two groups at that cut.

For example, in the five-leaf tree above, at height \(3.0\) the merge at \(2.5\) has happened, so \(\{A,B\}\) and \(\{C,D\}\) form one group. A wrong calculation might leave those as two groups because it overlooks the \(2.5\) merge, and report three groups: \(\{A,B\}\), \(\{C,D\}\), and \(\{E\}\). The correction is to include every merge below the cut: the actual groups are \(\{A,B,C,D\}\) and \(\{E\}\), for two clusters.

Another trap is to infer membership from nearby leaf labels or to treat a merge height as a count. Height \(2.5\) is a dissimilarity-axis value, not “two and a half clusters,” and two leaves that appear next to one another on the page need not be the first pair to merge. Trace the branches and check that every leaf appears exactly once.

Key takeaway: Read from the leaves upward, include the merges below the chosen cut, and report the resulting groups as well as their count. Use merge heights to locate a cut, but use the branch connections to determine membership.

Check Your Understanding

For each tree, determine the requested memberships and cluster count. Treat a merge at the cut height as included.

  1. A five-leaf tree has merges \(P\) with \(Q\) at \(0.3\), \(R\) with \(S\) at \(0.9\), \(\{P,Q\}\) with \(T\) at \(2.2\), and \(\{P,Q,T\}\) with \(\{R,S\}\) at \(3.7\). What are the clusters at height \(1.0\)? (Answer: \(\{P,Q\}, \{R,S\}, \{T\}\); 3 clusters.)
  2. A six-leaf tree merges \(A\) with \(B\) at \(0.5\), \(C\) with \(D\) at \(0.8\), \(E\) with \(F\) at \(1.2\), \(\{A,B\}\) with \(\{C,D\}\) at \(2.6\), and \(\{A,B,C,D\}\) with \(\{E,F\}\) at \(4.1\). What are the clusters at height \(3.0\)? (Answer: \(\{A,B,C,D\}, \{E,F\}\); 2 clusters.)
  3. A seven-leaf tree has merges \(A\) with \(B\) at \(0.4\), \(C\) with \(D\) at \(0.7\), \(E\) with \(F\) at \(1.0\), \(\{A,B\}\) with \(\{C,D\}\) at \(1.6\), \(\{A,B,C,D\}\) with \(G\) at \(2.8\), and \(\{A,B,C,D,G\}\) with \(\{E,F\}\) at \(4.5\). What are the memberships at height \(2.0\)? (Answer: \(\{A,B,C,D\}, \{E,F\}, \{G\}\); 3 clusters.)
  4. A six-leaf tree has merges \(K\) with \(L\) at \(0.6\), \(M\) with \(N\) at \(0.9\), \(O\) with \(P\) at \(1.3\), \(\{K,L\}\) with \(\{M,N\}\) at \(2.0\), and \(\{K,L,M,N\}\) with \(\{O,P\}\) at \(3.4\). Compare the cut at \(1.5\) with the cut at \(2.5\). (Answer: At \(1.5\): \(\{K,L\}, \{M,N\}, \{O,P\}\), 3 clusters; at \(2.5\): \(\{K,L,M,N\}, \{O,P\}\), 2 clusters.)
  5. A five-leaf tree has merges \(A\) with \(B\) at \(0.4\), \(C\) with \(D\) at \(0.8\), \(\{A,B\}\) with \(\{C,D\}\) at \(2.5\), and \(\{A,B,C,D\}\) with \(E\) at \(4.0\). How many clusters are present at height \(4.0\), and why? (Answer: 1 cluster; the final merge is included at the cut, joining all five leaves.)
Clinical Biostats