Hierarchical Clustering (Dendrogram) calculator
Build an agglomerative hierarchical clustering dendrogram online. Ward, average, complete and single linkage, cophenetic correlation, and cut the tree at any number of clusters.
What it does
Builds a tree by repeatedly merging the two closest clusters, starting from every point on its own. Cutting the tree at a height gives a partition, so you can see the structure at every number of clusters at once.
When to use it
You do not want to commit to a number of clusters in advance, or the nesting itself is interesting — subgroups within groups.
Alternatives
- K-Means — you know the number of clusters and have many rows — hierarchical clustering compares every pair, so it scales far worse
- DBSCAN — you expect noise points that belong to no cluster
- GMM — you want probabilistic membership rather than a hard cut
How to read the output
- The dendrogram and its merge heights
- Each join is drawn at the distance at which those two clusters merged. A join that happens much higher than the ones below it means two genuinely separate groups were forced together — which is where the natural cut lies. The left-to-right order of the leaves is not meaningful: any branch can be flipped without changing the tree. Do not read adjacency along the bottom as similarity.
- Linkage method
- How the distance between two CLUSTERS is defined from the distances between their points, and it changes the tree more than the metric does. Ward merges whatever costs least extra within-cluster variance (compact, similar-sized); complete uses the farthest pair (compact, sensitive to outliers); average is the middle ground; single uses the nearest pair. Single linkage chains: a thread of intermediate points welds two distinct groups into one long cluster. It is the right choice when clusters really are elongated, and the wrong default everywhere else.
- Distance metric
- Euclidean is straight-line distance; Manhattan sums the absolute differences; correlation compares the SHAPE of each row's profile while ignoring its overall level. Ward is defined through squared Euclidean distances, so the picker fixes the metric when Ward is chosen — on any other metric Ward's merge heights have no interpretation.
- Cophenetic correlation
- How well the tree's merge heights reproduce the original distances between points. Above about 0.85 the tree is a faithful summary. This asks a different question from silhouette: silhouette asks whether your CUT is clean, cophenetic asks whether the TREE means anything. A tidy cut through a distorted tree is still misleading, so read both.
- Silhouette
- Per point, how much closer it sits to its own cluster than to the nearest other one, averaged over the data. Roughly: above 0.5 is a clean separation, 0.25–0.5 is weak structure, below 0.25 is not a partition worth describing. It measures whether the CUT is clean, not whether the groups mean anything. A high silhouette on variables that are three versions of the same measurement describes your column list, not your subjects.
- Whether the data were scaled
- Every method here works on distances, and a distance adds up your columns' units. Standardizing puts each variable on the same footing before that sum is taken. Unscaled, the variable with the largest numeric range silently becomes the clustering. Income in pounds against age in years is a clustering of income. Turn scaling off only when the raw units are genuinely comparable and you mean to keep their relative weight.
- The cut
- The tree is cut to give the number of clusters you set, and the height of that cut is reported. Clustering always returns clusters, whether or not any exist — k-means will happily cut uniform noise into four tidy pieces. A partition is a hypothesis, not a finding: check the groups differ on a variable you did NOT cluster on before describing them as real.
How this calculator is validated · Which statistical test should I use?