HomeAI & Machine LearningK-Means Clustering: Finding Groups in Data Without Labels

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

Watch centroids hunt for natural groupings inside a 3D cloud of unlabeled data points, iteration by iteration, and see how the number of clusters you choose changes everything.

AI & Machine Learning3DAdvanced60 FPS
k-means-clustering-explained-lab ↗ Open standalone

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.

⚙ Under the hood

Watch centroids hunt for natural groupings inside a 3D cloud of unlabeled data points, iteration by iteration, and see how the number of clusters you choose changes everything.

machine learningclusteringdata analysisunsupervised learningk-meansartificial intelligenceThree.js

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)