What is Hierarchical Clustering?

Hierarchical Clustering is a family of algorithms that organizes samples into a nested tree by repeatedly merging clusters from the bottom up or splitting them from the top down.

Quick Facts

SpecificationOfficial Specification

How It Works

Treat linkage as part of the model

Single linkage can preserve curved connectivity but may chain groups through a few bridge points. Complete linkage favors compact groups and reacts to extreme cross-pairs. Average linkage balances all cross-pairs. Ward's original minimum-variance procedure has a different objective and requires compatible Euclidean input; the same word Ward has historically referred to differing software conventions.

Read a dendrogram as merge history, not certainty

A merge height records the linkage criterion at that step, not a calibrated probability that two groups belong together. Cutting the same tree at a cluster count or distance threshold creates different flat partitions. Ties, numeric precision, observation order, preprocessing, and non-monotone centroid or median linkages can change or complicate the displayed hierarchy.

Plan for quadratic state and transductive output

Current scikit-learn documentation supports Ward, complete, average, and single linkage plus optional connectivity constraints. Standard methods often retain a pairwise dissimilarity structure and can require quadratic memory. A fitted tree also does not by itself define how unseen samples enter existing branches.

Key Characteristics

  • Represents nested cluster relationships as a tree or dendrogram
  • Includes agglomerative bottom-up and divisive top-down strategies
  • Depends jointly on the sample metric and cluster linkage rule
  • Allows a flat partition to be selected after building the hierarchy
  • Makes greedy merge or split decisions that are usually not revisited
  • Can require quadratic memory and lacks a universal out-of-sample rule

Common Use Cases

  1. Exploring taxonomies at several levels of granularity
  2. Grouping a moderate document corpus for reviewer navigation
  3. Discovering nested biological or customer relationships
  4. Applying connectivity constraints to spatial or graph-adjacent data
  5. Comparing single, complete, average, and Ward linkage assumptions

Example

loading...
Loading code...

Frequently Asked Questions

What is the difference between agglomerative and divisive clustering?

Agglomerative clustering begins with singleton clusters and repeatedly merges; divisive clustering begins with one cluster and repeatedly splits. Both produce a hierarchy, but their search paths, optimization choices, and computational behavior differ.

Does a dendrogram determine the correct number of clusters?

No. It records a sequence of merges or splits under one metric and linkage. A cut height or target count turns that hierarchy into a flat partition, but the choice still needs stability, domain, and downstream evidence.

How do single, complete, average, and Ward linkage differ?

Single uses the closest cross-cluster pair, complete the farthest pair, average all cross-pairs, and Ward the increase in within-cluster variance. They encode different cluster shapes and cannot be swapped without changing the model.

Why can Ward implementations produce different dendrograms?

Libraries have historically differed over whether input dissimilarities are squared and how merge heights are reported. Ward's minimum-variance objective requires compatible Euclidean geometry, so record the exact library, option, metric, and preprocessing.

Can hierarchical clustering assign new samples?

A fitted dendrogram is usually transductive and describes the analyzed records. Production assignment needs a separate rule, such as nearest prototype or a trained classifier, and that rule must be evaluated independently from the original hierarchy.

Related Terms

Related Articles