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 →
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 →
Related concepts
- K-means clusteringcontrasts with · K-means clustering partitions data into a specified number of groups by assigning observations to representative centers and iteratively updating those centers to reduce within-group distances.
- 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 technique of grouping data items according to similarity or shared characteristics.
- 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.
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.




