K-means clustering is a classic algorithm in machine learning, but how does it actually start? In this interactive resource, you will explore its very first iteration. Once you understand this step clearly, you will be able to uncover how the following iterations continue until the algorithm finally stops.
Reinventing the K-Means Clustering
Let’s discover how the first iteration of the algorithm works!
You can use these instructions and questions to explore the first step of Iteration 1.
- Start by dragging two points (k = 2) to random positions within the data.
- Notice how the data points are divided into two clusters, one in blue and the other in red. What do you think determines which cluster each point belongs to?
- After placing the two points, observe the new points that appear (marked by arrows). In your opinion, how are these new points calculated?
Use these prompts to compare the clusters and resulted points after the first update in Iteration 1.
- The two cross-shaped points you see here are the updated positions from the previous step.
- Compare the clusters in Iteration 1-2 with those in Iteration 1-1. Are they the same, or have they changed? If they changed, how?
- What do you think will happen in Iteration 2? When do you think the iterations will stop?