Hierarchical clustering is a method that builds a nested tree of clusters from data, either by merging small groups upward or splitting a large group downward. The result is a dendrogram that shows relationships at multiple levels, and a chosen cut point determines the final clusters.
What hierarchical clustering does
Hierarchical clustering groups data into a nested structure rather than a single flat partition. It is useful when you want to see how observations relate at multiple levels, not just which cluster they end up in after a one-time split.
The key idea is that clusters are built step by step. In agglomerative clustering, the process starts with individual points and merges the closest groups upward. In divisive clustering, it starts with one broad group and splits it downward into smaller subclusters.
Dendrograms and cut points
The output is usually shown as a dendrogram, a tree-like diagram that makes the hierarchy visible. Branch height or distance encodes how similar or dissimilar groups were when they were joined or separated, which helps analysts inspect structure before choosing a final result.
A cut point turns the tree into usable clusters. Choosing a high cut produces fewer, broader clusters; choosing a lower cut produces more, smaller ones. That decision is often more important than the clustering algorithm itself because it determines the granularity of the final grouping.
Where hierarchical clustering fits
Hierarchical clustering is often used for exploration, taxonomy building, document grouping, customer segmentation, and anomaly review. It is especially helpful when the number of clusters is not known in advance and when the analyst wants an interpretable structure rather than only a hard assignment.
It is also valuable when relationships between groups matter. Because the method preserves nested similarity, it can show both local proximity and broader family structure, which flat clustering methods do not expose as clearly.
Strengths and limitations
Its main strength is interpretability. The tree structure lets practitioners inspect how groupings emerge and compare alternative cut points. It can work with many distance measures, which makes it flexible for different kinds of data.
Its main limitation is that early choices can shape the whole tree. Once two points or clusters are merged, that decision is not revisited in standard hierarchical clustering, so poor distance choices, noisy features, or outliers can distort the result. The method can also become expensive on very large datasets.