What is k-means Algorithm?

<aside> 💡

k-means is a simple and popular clustering algorithm. It groups data into K clusters by repeatedly assigning points to the nearest cluster center (centroid) and then updating those centroids as the mean of assigned points.

</aside>


Key idea


Steps

  1. Initialize centroids

  2. Assign points to clusters

    IMG_20250815_074549.jpg

  3. Update centroids

  4. Repeat


image.png


Notes & tips