Hierarchical Clustering
- Definition
- Hierarchical Clustering builds a tree of clusters either by merging small clusters upward or splitting large ones downward. Think of forming a family tree of groups where you can cut the tree at any level to get a clustering. It differs from flat methods (like k-means) because it provides multi-scale structure and doesn't force a fixed number of clusters upfront.

How does it work?
Hierarchical Clustering models learn from labeled examples: prepare features, choose a model family, train on examples, and validate on held-out data. Pay attention to data preprocessing, class imbalance, and hyperparameter tuning.
Examples
- Phylogenetic trees — Build hierarchical relations between species based on genetic distance.
- Customer hierarchy discovery — Reveal nested segments in user bases for tiered targeting.
- Agglomerative image grouping — Cluster visual features hierarchically for multi-scale analysis.
Problems
- Computationally expensive (often O(n^2) or worse) on large datasets
- Choosing where to cut the dendrogram is subjective
- Sensitive to the choice of linkage method and distance metric
- Cannot easily undo early merge/split decisions