Introduction

An example of a dendrogram representing a hierarchical cluster analysis of cars.

An example of a dendrogram representing a hierarchical cluster analysis of cars.

<aside> 💡

Hierarchical clustering builds nested clusters in a hierarchical tree structure, either from the bottom up (agglomerative) or the top down (divisive).

</aside>

In the agglomerative approach, each data point starts as its own cluster. The algorithm identifies the two closest clusters based on a distance metric, such as single-linkage or complete-linkage, and merges them into a single cluster. This merging process is repeated iteratively until all data points form one single cluster.

In the divisive approach, the process starts with all data points in a single cluster, which is recursively split until each data point is its own cluster. The final output is a dendrogram, a tree-like diagram that represents the hierarchical structure of the clusters.

graph TD
    A[Start with individual points] --> B[Find closest clusters]
    B --> C[Merge clusters]
    C --> D{One cluster remaining?}
    D -- No --> B
    D -- Yes --> E[Form hierarchical tree]

Example

In sport, hierarchical clustering could be used to analyse football team performances across multiple matches. Metrics such as possession percentages, shots on target, and goal differences could reveal clusters of teams with similar performance profiles.

The dendrogram might show clusters of elite teams, mid-level teams, and underperforming teams.

More detail

Hierarchical clustering creates nested clusters organised into a tree-like structure, either from the bottom up (agglomerative) or the top down (divisive).

In the agglomerative approach, each data point initially forms its own cluster. At each step, the two clusters with the smallest distance are merged.

The distance between two clusters A and B can be defined in several ways, such as single-linkage (minimum distance), complete-linkage (maximum distance), or average-linkage:

$$ Single-linkage: d(A, B) = \min_{x \in A, y \in B} \|x - y\| $$

$$ Complete-linkage: d(A, B) = \max_{x \in A, y \in B} \|x - y\| $$

$$ Average-linkage: d(A, B) = \frac{1}{|A||B|} \sum_{x \in A} \sum_{y \in B} \|x - y\| $$

This merging continues until all data points are grouped into one cluster, forming a dendrogram. Divisive clustering works in the opposite direction, starting with one large cluster and recursively splitting it.

In a sports context, hierarchical clustering could analyse match statistics, such as possession percentages, shots on target, and goal differences, to cluster teams into performance levels. The dendrogram might reveal clusters of elite teams, mid-level teams, and underperformers.