MakarovSuites
English
EnglishDeutschРусскийУкраїнськаFrançaisEspañolItalianoPolski
Contact & licences

Math

k-means clustering

Step through k-means assignments and centroid updates, move centres manually and compare cluster counts on an elbow curve.

k-means clustering — Actual application image
Actual application image

Try this

Alternate centroid updates and nearest-centroid assignments. Click the cloud to move the nearest centroid. Empty clusters keep their previous centre. The lower elbow curve shows the best of five k-means++ runs for each k; local minima can still occur.

Equations used in the module
Equations
J = Σᵢ ||xi−μlabel(i)||²
Assignment: label(i) = argminⱼ ||xi−μj||²
Update: μj = mean of points assigned to j
Each Lloyd half-step cannot increase J; global minimum is not guaranteed

Related experiments

Back to catalogue
Four colours for any map — Actual application image

Math

Four colours for any map

Colour generated planar maps, inspect their adjacency graphs and compare greedy choices with a constrained backtracking search.

Langton's ant — Actual application image

Math

Langton's ant

Run Langton’s ant on a sparse unbounded lattice, change multicolour turn rules and inspect the classic 104-step highway.