0PricingLogin
Machine Learning Academy · Lesson

K-Means: Centroids, Assignment, and Update Steps

Learners will trace three iterations of K-Means by hand, assign points to nearest centroids, recompute centroids, and watch convergence on a 2D scatter plot.

What Is K-Means Clustering?

K-Means is an unsupervised algorithm that partitions n data points into k non-overlapping clusters. Unlike supervised learning, there are no labels — the algorithm discovers structure purely from the feature values. K-Means is fast, scalable, and widely used for customer segmentation, image compression, and anomaly detection.

The Three-Step Algorithm

K-Means repeats three steps until convergence: 1) Initialise — randomly place k centroids in feature space. 2) Assignment — assign every point to the nearest centroid. 3) Update — move each centroid to the mean of its assigned points. The loop stops when assignments no longer change.

All lessons in this course

  1. K-Means: Centroids, Assignment, and Update Steps
  2. Choosing K: Elbow Method and Silhouette Score
  3. DBSCAN: Core Points, Border Points, and Noise
  4. Clustering for Customer Segmentation: End-to-End Example
← Back to Machine Learning Academy