Visualize and play with the kMeans algorithm.
This program uses the pygame library.
G to generate random data.
D to change random data type.
S to take a step of k-means.
Q to randomly add another cluster.
A to delete most recent cluster.
W to randomly assign centroids.
T to toggle trails.
X to toggle Centroid / Draw modes.
Centroid Mode (default):
Left click to add a centroid at your cursor.
Right click to remove nearest centroid (highlighted by a white circle).
C to change the color of the nearest centroid.
Draw Mode:
Left click to draw points.
Right click to delete points.
C to clear the data.
E/D to increase/decrease brush size.
R/F to increase/decrease brush density.