Home/Machine Learning/Hierarchical Clustering
Machine Learning

Hierarchical Clustering

Grouping data by building a tree of nested clusters — no need to pick the number of clusters in advance, and you get the whole family structure, not just a flat grouping.

Reviewed July 15, 2026Stable
Reading level: Curious
Pick your depth ↓

When not to use it

  • On large datasets — its O(n²)+ cost doesn't scale; use k-means or mini-batch methods.
  • When you already know K and just need a fast flat clustering — k-means is simpler and quicker.
  • When clusters are known to be spherical and well-separated — simpler methods suffice.

Reach for something else instead

  • K-means for fast, scalable flat clustering when you know (or will search for) K.
  • DBSCAN for density-based clusters of arbitrary shape without specifying K.
  • Gaussian mixture models for soft, probabilistic cluster assignments.

Further reading

  • Ward (1963), Hierarchical Grouping to Optimize an Objective Function — Ward's linkage.
  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning — hierarchical clustering and linkage criteria.
  • Müllner (2011), Modern hierarchical, agglomerative clustering algorithms — efficient implementations.

Primary sources, listed so you can check the claims on this page rather than take them on trust.

Where people go wrong

  • Applying it to large datasets and hitting the quadratic memory wall.
  • Ignoring the linkage choice — it materially changes the resulting tree.
  • Treating the dendrogram cut height as arbitrary rather than reading it from the data's structure.

At a glance

FieldMachine Learning
Outputa tree (dendrogram) of nested clusters
Advantageno K needed, shows structure
Costdoesn't scale (O(n²)+)
DifficultyIntermediate
Flashcards for this concept · study, save or share them →
Question
Answer
1 / 4

Where this sits

A destination. 3 concepts lead here, and nothing in the corpus depends on it.

3Levelsteps in
3Needs firstconcepts
0Opens upnothing further
1Areastays here
Learn these firstClustering
LEARN FIRST Clustering HierarchicalClustering
Hierarchical Clustering sits after Clustering, and nothing further depends on it.

Computed from the prerequisite graph, not assigned. How this works