K-Means · 2D · 20 Training Monsters

K-Means Clustering Lab

A step-by-step walkthrough of K-Means clustering in two dimensions. You choose how to project the data — or let the algorithm show you what it sees.

Step 1 of 6 — The Data
Meet the 20 KMONST monsters

Each monster is described by six features. Before running the algorithm, understand what each feature measures and how color encodes warmth.

Warmth is read from the color wheel. Blue = 0 (coolest). Orange = 6 (warmest). Moving in either direction from blue adds 1 — so red and yellow monsters can both score 4, because both are 4 steps from blue on opposite sides of the wheel.

Feature What it measures Range
Warmth Color temperature — distance from blue on the color wheel 0 – 6
Eyes Number of eyes 1 – 4
Feet Number of feet 0 – 4
Teeth Number of visible teeth 0 – 4
Solid Body is a solid color — no markings or patterns 0 or 1
Wings Has wings or wing-like appendages 0 or 1
Step 2 of 6 — Projection
How will the data be projected onto two axes?

Each monster has six features, but a plot needs exactly two dimensions. We combine those six numbers into two — one for the horizontal axis and one for the vertical — by multiplying each feature by a coefficient and adding the results up.

Option A
Official PC1 / PC2
Coefficients determined by the algorithm from the training data itself. This is the projection the K-Means model actually used.
Option B
Your own X / Y
You choose which features contribute to each axis and how much weight each one carries.
Select a mode and assign at least one feature to each axis before continuing.
Step 3 of 6 — Centering
Center the data before projecting

Before multiplying by any coefficient, each feature value is centered — shifted so that the average of that feature across all 20 monsters becomes zero. This is not an arbitrary adjustment: the average is a real property of this specific training dataset, not the theoretical midpoint of the possible range.

Average feature values across all 20 training monsters

Notice that the mean of Warmth is 2.50 — not 3.0. These 20 monsters lean slightly cool. A different training set would produce different means, a different center, and different coordinates for everything.

Try it — enter a monster number to see the full calculation
M Enter any number from 1 to 20
Step 4 of 6 — The Map
All 20 monsters on the coordinate plane

Tap any monster dot to see its full calculation.

Look for natural groupings before placing your starting centroids in the next step.

Step 5 of 6 — Starting Centroids
Place your three starting centroids

Drag each ★ star to where you think a cluster center might be. This is your best guess — the algorithm will refine the positions from here. Stars snap to the nearest 0.5 unit.

Step 6 of 6 — K-Means
Tap any monster dot to see its distances to each centroid.