Notes

Average Linkage

When hierarchical clustering builds groups, it needs a rule for deciding which two clusters are “closest” at each step. Average linkage is one of those rules: instead of looking only at the nearest pair of points or the farthest pair, it looks at the average distance between all point pairs across two clusters.

How it works

Suppose cluster A has several points and cluster B has several points. Average linkage computes the distance from every point in A to every point in B, then takes the mean of those distances. If that average is small, the clusters are considered similar and are good candidates to merge. In agglomerative hierarchical clustering, this calculation is repeated after each merge, producing the familiar dendrogram. You can think of it as a compromise between single linkage, which can create long “chains,” and complete linkage, which prefers very tight clusters.

Why it matters

The linkage choice changes the shape of the clusters you get. Average linkage tends to produce groups that are reasonably cohesive without being overly strict about the most distant points. That makes it useful when real data has some spread or noise.

  • In customer segmentation, it can merge customer groups based on overall similarity rather than one unusually close or far customer.
  • In document clustering, it helps group topics using the average similarity across documents, not just one standout article.
  • In gene expression or transaction pattern analysis, it gives a balanced view of cluster similarity.

In practice

You will see average linkage in tools like SciPy’s scipy.cluster.hierarchy.linkage(..., method="average") and scikit-learn’s hierarchical clustering tools. Its behavior also depends on the distance metric you pair it with, such as Euclidean or cosine distance. Ignore the linkage choice, and hierarchical clustering can tell a very different story about the same data; choose average linkage, and you get a middle-ground notion of cluster closeness that is often easier to trust.

Average Linkage is a hierarchical clustering criterion that defines the distance between two clusters as the average of all pairwise distances between points in one cluster and points in the other. It balances the chaining tendency of single linkage and the compactness bias of complete linkage. This matters because the linkage rule directly determines which clusters merge, shaping the dendrogram and the final cluster structure extracted from unlabeled data.

Imagine merging friend groups by asking, “On average, how close are the people in one group to the people in the other?” That is the idea behind Average Linkage.

In AI, it is a way of deciding which groups of data should be joined when building clusters — natural groupings in unlabeled data. Instead of looking only at the single closest pair or the single farthest pair, Average Linkage uses the average closeness across all members of both groups. That makes it a balanced choice. It helps AI form groups that reflect the overall similarity between collections of items, like customers, songs, or photos, rather than being overly influenced by one unusually close or distant example.