Skip to content
AI360Xpert
Visual Explainers
Visual explainer

Clustering

How we find natural groupings in unlabelled data.

We have data points but no labels to tell us what they are.
We have data points but no labels to tell us what they are.

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 primitive: assign points to the nearest center.
K-means primitive: assign points to the 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

The K-Means loop: assign points, then move centers.
The K-Means loop: assign points, then move centers.

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

Hierarchical clustering builds a tree of relationships instead of flat groups.
Hierarchical clustering builds a tree of relationships instead of flat groups.

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

Distance-based clustering fails on complex, non-globular shapes.
Distance-based clustering fails on complex, non-globular shapes.

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.