Hartigan–Wong algorithm
Topic of K-means clustering, part of Statistical learning
Hartigan–Wong algorithm
| Type | Topic |
| Taught in | K-means clustering |
| Part | Statistical learning |
The default k-means algorithm in R. It targets the same within-cluster sum of squares as Lloyd’s algorithm but moves single points between clusters whenever that lowers the criterion, which lets it escape some of Lloyd’s local optima.
In K-means clustering
From K-means clustering
The fragment standardises the variables, tries 25 starts and retains the smallest reported within-cluster sum of squares. The default kmeans uses the Hartigan–Wong algorithm, which targets the same sum of squares and uses different updates. Specify algorithm = "Lloyd" when reproducing the alternating steps above. The iris laboratory uses the default and checks the reported objective directly.
Used in
See also
Lloyd’s K-means algorithm · K-means as a limiting case · Within-cluster scatter · Descent of Lloyd’s algorithm · Why the raw sum of squares cannot choose · K-means criterion · From pairs to cluster means · Why the partitions are not all searched