Skip to content

Hierarchical Clustering

Building a tree of clusters by merging or splitting groups, reading dendrograms and choosing where to cut.

Editorial team 1 min read

Hierarchical clustering builds a hierarchy of clusters rather than a single partition.

Two Approaches

  • Agglomerative (bottom-up): start with each point as its own cluster and repeatedly merge the closest pair.
  • Divisive (top-down): start with one cluster and repeatedly split.

Agglomerative is far more common.

Linkage Criteria

How is the distance between clusters measured?

  • Single: closest pair of points — can create long chains.
  • Complete: farthest pair — compact clusters.
  • Average: mean distance between all pairs.
  • Ward: merges that least increase within-cluster variance — often a good default.

Dendrograms

The result is shown as a tree. Cutting the tree at a height gives a set of clusters; large vertical gaps suggest natural cut points.

Strengths

  • No need to choose the number of clusters in advance.
  • Reveals structure at several levels.

Limitations

  • Computation grows quickly with data size, so it suits thousands rather than millions of points.
  • Merges can't be undone.
  • Sensitive to scaling and distance choice.

More in Machine learning

All Machine learning guides →
Machine learning Guide · 2 min

Linear Regression Explained

The simplest predictive model: how linear regression fits a line through data, how to read its coefficients, and when it breaks down.

Machine learning 2 min read 17 Sep 2026

Machine learning Guide · 2 min

Logistic Regression for Classification

Despite its name, logistic regression is a classification method. How it produces probabilities and why it remains a strong baseline.

Machine learning 2 min read 16 Sep 2026

Machine learning Guide · 2 min

Decision Trees

How decision trees split data with simple questions, why they are easy to explain, and why single trees overfit.

Machine learning 2 min read 15 Sep 2026

Machine learning Guide · 2 min

Random Forests

Why averaging many randomised decision trees produces a robust, accurate model with little tuning.

Machine learning 2 min read 14 Sep 2026