Hierarchical Clustering for Segmentation
You'll learn how hierarchical clustering builds nested customer segments from the bottom up, helping you discover natural groupings and determine the ideal number of segments without pre-specifying cluster counts.
Why Hierarchical Clustering Matters
Unlike K-Means (which requires you to choose k upfront), hierarchical clustering reveals the natural structure of your customer base by building a tree of relationships. It starts by treating each customer as their own cluster, then progressively merges the most similar ones—creating a hierarchy that shows both fine-grained and broad segments simultaneously.
Think of it like a family tree: individuals combine into households, households into neighborhoods, neighborhoods into cities. At every level, you see meaningful groupings.
How It Works
The algorithm measures distances between all customers (using metrics like RFM scores, purchase behavior, or engagement patterns). It then:
- Merges the two closest customers/clusters
- Recalculates distances between the new cluster and all others
- Repeats until all customers form one giant cluster
The result is a dendrogram—a tree diagram showing merge history. By "cutting" the tree at different heights, you try different segment counts and compare their quality.
Finding the Right Number of Segments
The dendrogram visually suggests natural breaks: long vertical lines indicate distinct groups. You can also use metrics like the elbow method on within-cluster variance or silhouette scores to quantify segment quality at each cut point.
This nested structure is invaluable for customer lifecycle analysis—you might discover that your "engaged users" segment naturally splits into "power users" and "regular actives," or that "at-risk" customers have two distinct sub-populations requiring different retention strategies.
Key Takeaway: Hierarchical clustering reveals nested segment structures without pre-committing to a cluster count, letting the data guide your segmentation strategy through interpretable dendrograms.