What information entered the process?
Labs / Computer Science
K-Means Clustering
Pick how many clusters you want, then hit Step (or let it auto-run) to watch the algorithm work. Every round each point recolors to its nearest centroid, and every centroid slides to the average position of the points that chose it — repeat until nothing moves. Click empty space to drop in your own points.
Labs / Computer Science / K-Means Clustering
K-Means Clustering
Pick how many clusters you want, then hit Step (or let it auto-run) to watch the algorithm work. Every round each point recolors to its nearest centroid, and every centroid slides to the average position of the points that chose it — repeat until nothing moves. Click empty space to drop in your own points.
Why it matters
Why explore this?
Computer science turns clear rules into reliable processes. This model lets you step through those rules and see how each decision changes the result.
Explore
Try the model
Investigate
Questions to test
Predict first, try it in the model, then use what you observe to answer.
What to try
- Does the inertia readout ever go up from one step to the next, or only down?
- Hit Reseed a few times without changing anything. Do the centroids always settle in the same place?
- The data was made from four blobs. What happens when you ask for only k = 2 clusters — or as many as k = 5?
- Click to add a lone point far from every cluster. How much does one outlier drag its centroid around?
- How many iterations does it usually take to converge? Does more k mean more steps, or fewer?
Explain
Make sense of what happened
Trace the process one step at a time. Name the rule used at each important step, then explain why the final result follows from those rules.
Check
Before you leave
Which rule changed it?
Why did the process produce this result?
If you can answer all three using evidence from the model, you understand the main idea. If not, return to Explore and change one setting at a time.