Hierarchical clustering
Hierarchical clustering is a clustering method that organizes observations into nested groups by successively merging or splitting clusters.
Data Without Labels
Hierarchical clustering is a clustering method that constructs a nested hierarchy of groups by successively merging or splitting clusters.
- How it is used
- Supports customer segmentation by producing nested groups that can be cut and assessed against business needs.
- How deep it goes
- Explains merging, splitting, greedy choices, dendrogram cuts, and a Python workflow; leaves the best cluster count to interpretation.
- Examples
- Uses five numbered observations, three linkage visualizations, and Python plots showing how distance cutoffs change clusters.
- What you can do after
- Apply it via SciPy linkage and fcluster, then inspect dendrograms and plotted groups before selecting a distance cutoff.
Read how Data Without Labels explains hierarchical clustering →
Statistics Slam Dunk
Hierarchical clustering is a clustering method that builds a nested hierarchy of groups based on similarity or distance.
- How it is used
- Segments NBA draft picks to assess whether top-five selections warrant different career expectations from other first-round picks.
- How deep it goes
- Works through variable selection, mean aggregation, Euclidean distances, a distance matrix, complete-linkage hclust(), and dendrogram interpretation.
- Examples
- Uses 2000–2009 NBA first-round pick numbers and mean career win shares, highlighting a two-group split of picks 1–5 and 6–30.
- What you can do after
- Build it from scratch in base R by creating distances, running hclust(), plotting a dendrogram, and inspecting chosen cluster boxes.
Read how Statistics Slam Dunk explains hierarchical clustering →
Build a Robo-Advisor with Python (From Scratch)
Hierarchical clustering is a clustering technique that organizes objects into progressively combined or subdivided groups according to a distance measure.
- How it is used
- Organizes correlated assets into an HRP tree before covariance reordering and recursive portfolio-weight allocation.
- How deep it goes
- Derives two distance matrices and implements iterative linkage, while deferring weight calculation to recursive bisection.
- Examples
- Works through eight ETF tickers, a distance matrix, cluster merges, asset ordering, and reordered correlation heatmaps.
- What you can do after
- Build it from scratch by transforming correlations into distances and merging the nearest asset clusters into a link matrix.
Read how Build a Robo-Advisor with Python (From Scratch) explains hierarchical clustering →
Build AI Drug Discovery Pipelines
Hierarchical clustering is a clustering technique that builds a hierarchy of nested groups by iteratively merging or splitting clusters.
- How it is used
- Supports selecting structurally representative and diverse compounds from molecular libraries.
- How deep it goes
- Explains agglomerative and divisive procedures, linkage choices, fingerprint implementation, dendrograms, and sampling, but not clustering theory in depth.
- Examples
- Uses RDKit fingerprints, scikit-learn models, dendrograms, representative sampling, and diversity-versus-redundancy evaluation.
- What you can do after
- Apply it via RDKit and scikit-learn to cluster compounds and sample representatives for library screening.
Read how Build AI Drug Discovery Pipelines explains hierarchical clustering →
Advanced Algorithms and Data Structures
Hierarchical clustering is a clustering technique that forms nested groups by successively merging or dividing clusters.
- How it is used
- Uses unlabeled data to infer related groups and inspect alternative partitions for applications such as customer segmentation.
- How deep it goes
- Explains agglomerative construction, dendrograms, slicing, and parameter effects, but leaves the broader clustering taxonomy beyond the treatment.
- Examples
- Uses two-dimensional point datasets, progressive A–B–C grouping, dendrograms, reachability plots, and customer segmentation.
- What you can do after
- Evaluate or understand nested clusters, choose hierarchy snapshots, and relate implementation needs to disjoint-set data structures.
Read how Advanced Algorithms and Data Structures explains hierarchical clustering →
Domain-Specific Small Language Models
A clustering approach that builds communities through repeated refinement and aggregation of grouped items.
- How it is used
- Detects communities for GraphRAG indexing and later community summarization.
- How deep it goes
- Explains the move-refine-aggregate loop and modularity gain, but stops short of a full validated implementation.
- Examples
- Uses a combined graph, community summaries, and a custom Python Leiden implementation.
- What you can do after
- Apply it to partition graphs into communities for downstream summarization and query answering.
Read how Domain-Specific Small Language Models explains hierarchical clustering →
Grokking Machine Learning, Second Edition
Hierarchical clustering is a clustering algorithm that progressively groups the closest data points or existing groups into a hierarchy.
- How it is used
- Groups similar data points for unsupervised learning and applications such as user-based video recommendations.
- How deep it goes
- Defines the progressive grouping process but stops short of implementation details or a detailed treatment of unsupervised learning.
- Examples
- Uses an email dataset with message size and recipient counts, alongside video-recommendation groups based on user information and viewing history.
- What you can do after
- Evaluate/understand how progressively grouping nearby points produces well-defined categories.
Read how Grokking Machine Learning, Second Edition explains hierarchical clustering →
Timeless Algorithms, The Foundational Ideas
Hierarchical clustering constructs nested groups by successively merging or splitting clusters.
- How it is used
- Reveals nested groups in unsupervised analysis when predefined categories are absent.
- How deep it goes
- Defines dendrograms and merging or splitting, but does not detail linkage criteria or implementation.
- What you can do after
- Understand how nested cluster structures can be formed by successive merging or splitting.
Read how Timeless Algorithms, The Foundational Ideas explains hierarchical clustering →
Also covered in
What to know first
- K-means clusteringK-means clustering is an algorithm that partitions data into a specified number of clusters by iteratively assigning observations to the nearest centroid and updating each centroid to the mean of its assigned observations.
- supervised learningSupervised learning is a machine-learning approach that learns predictive relationships from examples paired with known target outputs or labels.
- unsupervised learningUnsupervised learning is a machine-learning approach that discovers patterns, structure, or representations in data without labeled target outputs.
- centroidA point representing the center of a set of points or a region, commonly calculated as the coordinate-wise mean or, for weighted points, the weighted mean.
Related concepts
- K-means clusteringcontrasts with · K-means clustering is an algorithm that partitions data into a specified number of clusters by iteratively assigning observations to the nearest centroid and updating each centroid to the mean of its assigned observations.
- OPTICSincludes · OPTICS is a density-based clustering algorithm that orders points and computes reachability distances to reveal cluster structure across varying density thresholds.
- unsupervised learningkind of · Unsupervised learning is a machine-learning approach that discovers patterns, structure, or representations in data without labeled target outputs.
- clusteringkind of · Clustering is the process of grouping data items so that items within a group are more similar to one another than to items in other groups.
- agglomerative clusteringincludes · Agglomerative clustering is a bottom-up hierarchical clustering method that starts with individual items as separate clusters and repeatedly merges clusters according to a linkage criterion.
- dendrogramproduces · A dendrogram is a tree diagram that represents hierarchical relationships among items or nested clusters, including the levels at which they merge or split.
Questions about hierarchical clustering
What is hierarchical clustering?
Hierarchical clustering is a clustering method that organizes observations into nested groups by successively merging or splitting clusters.
Which Manning books explain hierarchical clustering?
Data Without Labels, Statistics Slam Dunk, Build a Robo-Advisor with Python (From Scratch), Build AI Drug Discovery Pipelines, Advanced Algorithms and Data Structures, Domain-Specific Small Language Models, Grokking Machine Learning, Second Edition and Timeless Algorithms, The Foundational Ideas.
What should I know before learning hierarchical clustering?
Manning books that teach hierarchical clustering usually introduce K-means clustering, supervised learning, unsupervised learning and centroid first.
What is the difference between hierarchical clustering and K-means clustering?
Hierarchical clustering is a clustering method that organizes observations into nested groups by successively merging or splitting clusters. K-means clustering is an algorithm that partitions data into a specified number of clusters by iteratively assigning observations to the nearest centroid and updating each centroid to the mean of its assigned observations.
What kinds of hierarchical clustering are there?
Kinds of hierarchical clustering include OPTICS and agglomerative clustering.
What is hierarchical clustering a kind of?
Hierarchical clustering is a kind of unsupervised learning. Unsupervised learning is a machine-learning approach that discovers patterns, structure, or representations in data without labeled target outputs.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







