Playground
Playground
Lloyd's algorithm, e-means and h-means run on the same 2-D points from the same random initial rows. The x axis counts distance computations in units of one pass over the data (n·k), which makes the comparison independent of hardware. Lower loss is better.
Lloyd k-means
e-means
h-means
Loss (MSE) against passes over the data
Press Train to start.
What runs: Lloyd re-seeds empty clusters by splitting. e-means uses its published laws with the batch law's quality setting (B/8) and, as in the authors' playground, no dead-cluster revival on 2-D data. h-means seeds with a half pass over k/16 coarse centroids, splits each coarse cluster into children in proportion to its loss, runs e-means passes whose assignment uses Hartigan's rule with the EMA mass as the cluster size, and finishes with exact Hartigan passes. Held-out loss uses 20% extra points drawn from the same shape. Everything runs in this tab, single-threaded; the JavaScript port was cross-checked against the Python reference on the same distributions (within 4%).
Two dimensions are the regime the e-means authors flag as outside their fitted laws (dead-cluster revival is switched off at d ≤ 2), which is why the gap here is far larger than on real embeddings. The results page has the numbers that matter: SIFT, GloVe, NYTimes, Fashion-MNIST, Deep-10M.