Lloyd-Max Algorithm

Instead of uniform buckets, Lloyd-Max places centroids to minimize mean-squared error under the actual data distribution. This animation exposes the two substeps separately: one step moves the centroids to the center of mass of each bucket, and the next step moves the boundaries to the midpoints between centroids.

Iter 0
MSE
Click "Step" to begin iteration
Centroids
Boundaries
Bucket regions