Clustering
How we find natural groupings in unlabelled data.
When data arrives without labels, we have to rely on its inherent structure. Clustering algorithms look at the distances between points to find natural groupings, turning a single undifferentiated blob into distinct categories.
Assign to Nearest Center
K-Means works by placing a few center points in the space, then assigning every data point to whichever center is closest.
The K-Means Loop
Once points are assigned, the centers move to the middle of their new groups. The process repeats—reassign, then move—until the centers stop shifting.
Flat vs Hierarchical
While K-Means forces data into a flat list of distinct groups, hierarchical clustering builds a tree. This reveals relationships at multiple scales, showing how small clusters merge into larger ones.
Where It Breaks
Because K-Means assumes clusters are spherical, it draws rigid linear boundaries. If your data forms complex shapes like interlocking crescents, simple distance metrics will slice them right down the middle.
The Quick Version
- Unlabelled data: Find structure without prior labels.
- K-Means primitive: Assign every point to the closest center.
- The loop: Reassign points, move centers, repeat.
- Hierarchical: Build a tree of sub-clusters instead of flat lists.
- The limit: Fails on interlocking or non-spherical shapes.