Ward's minimum variance criterion minimizes the total within-cluster variance. To implement this method, at each step find the pair of clusters that leads to minimum increase in total within-cluster variance after merging. This increase is a weighted squared distance between cluster centers. At the initial step, all clusters are singletons (clusters containing a single point). To apply a recursive algorithm under this objective function, the initial distance between individual objects must be (proportional to) squared Euclidean distance.
The initial cluster distances in Ward's minimum variance method are therefore defined to be the squared Euclidean distance between points:
Note: In software that implements Ward's method, it is important to check whether the function arguments should specify Euclidean distances or squared Euclidean distances.
Ward's minimum variance method can be defined and implemented recursively by a Lance–Williams algorithm. The Lance–Williams algorithms are an infinite family of agglomerative hierarchical clustering algorithms which are represented by a recursive formula for updating cluster distances at each step (each time a pair of clusters is merged). At each step, it is necessary to optimize the objective function (find the optimal pair of clusters to merge). The recursive formula simplifies finding the optimal pair.
Suppose that clusters C i {\displaystyle C_{i}} and C j {\displaystyle C_{j}} were next to be merged. At this point all of the current pairwise cluster distances are known. The recursive formula gives the updated cluster distances following the pending merge of clusters C i {\displaystyle C_{i}} and C j {\displaystyle C_{j}} . Let
An algorithm belongs to the Lance-Williams family if the updated cluster distance d ( i j ) k {\displaystyle d_{(ij)k}} can be computed recursively by
where α i , α j , β , {\displaystyle \alpha _{i},\alpha _{j},\beta ,} and γ {\displaystyle \gamma } are parameters, which may depend on cluster sizes, that together with the cluster distance function d i j {\displaystyle d_{ij}} determine the clustering algorithm. Several standard clustering algorithms such as single linkage, complete linkage, and group average method have a recursive formula of the above type. A table of parameters for standard methods is given by several authors.234
Ward's minimum variance method can be implemented by the Lance–Williams formula. For disjoint clusters C i , C j , {\displaystyle C_{i},C_{j},} and C k {\displaystyle C_{k}} with sizes n i , n j , {\displaystyle n_{i},n_{j},} and n k {\displaystyle n_{k}} respectively:
Hence Ward's method can be implemented as a Lance–Williams algorithm with
The popularity of the Ward's method has led to variations of it. For instance, Wardp introduces the use of cluster specific feature weights, following the intuitive idea that features could have different degrees of relevance at different clusters. 5
Ward, J. H., Jr. (1963), "Hierarchical Grouping to Optimize an Objective Function", Journal of the American Statistical Association, 58, 236–244. /wiki/Journal_of_the_American_Statistical_Association ↩
Cormack, R. M. (1971), "A Review of Classification", Journal of the Royal Statistical Society, Series A, 134(3), 321-367. /wiki/Journal_of_the_Royal_Statistical_Society ↩
Gordon, A. D. (1999), Classification, 2nd Edition, Chapman and Hall, Boca Raton. ↩
Milligan, G. W. (1979), "Ultrametric Hierarchical Clustering Algorithms", Psychometrika, 44(3), 343–346. ↩
R.C. de Amorim (2015). "Feature Relevance in Ward's Hierarchical Clustering Using the Lp Norm" (PDF). Journal of Classification. 32 (1): 46–62. doi:10.1007/s00357-015-9167-1. S2CID 18099326. http://repository.essex.ac.uk/20365/1/MW_Ward.pdf ↩