Gradient
Lesson 6.10ModelCode~45 min

Learning without labels

k-means finds groups no one told it about. Watch it, then build it.

Module 6 · 0/11 done

No answers, just data

Everything so far was supervised: every example came with the right answer. Often you have no answers at all — just a pile of data — and you want to discover its structure. Which customers behave alike? Which news stories are about the same event? Which colours appear in this photo?

The classic tool is k-means clustering. You choose how many groups you want (k), and it alternates two simple steps until nothing changes:

  1. Assign: every point joins the group whose centre (×) is nearest.
  2. Update: every centre moves to the average position of its group.