← 📊 Data Science

📊 K-Means Lab

Iteration: 0
Inertia (WCSS):
Status: running…
FPS:
Drag — rotate · Scroll — zoom

📊 K-Means Clustering: Finding Groups in Data Without Labels

A 3D cloud of unlabeled points, colored live by which of K glowing centroids they're currently closest to, as Lloyd's algorithm alternates between assigning points and re-centering centroids until it converges.

🔬 What It Demonstrates

Each iteration re-assigns every point to its nearest centroid, then moves each centroid to the mean of its assigned points. Inertia (total squared distance) only ever decreases, and the process settles into a local optimum.

🎮 How to Use

Pick how many clusters K the algorithm should look for, how many true blobs actually generated the data, and how many points to scatter. Step through iterations manually or let it auto-run, then regenerate fresh data.

💡 Did You Know?

Set K far from the true number of blobs and watch what happens — too few clusters merges distinct groups, too many splits a single natural group into fragments. Choosing K is genuinely part of the art of clustering.