k-Means Clustering


1. What is K-Means?

Example: Suppose you want to divide customers into 3 groups based on their income and age.


2. How Does K-Means Work?

Step by step intuition:

  1. Choose K → Decide how many clusters (groups) you want.
  2. Place centers → K-Means starts with K random points as “centers.”
  3. Assign points → Each data point is assigned to the nearest center.
  4. Update centers → Move each center to the average position of its assigned points.