Model Atlas · Clustering

K-Means

Partitions observations around centroids and provides a simple baseline for segmentation.

core mathematical viewmin Σᵢ ||xᵢ-μcᵢ||²
Mental model

Understand it before memorizing it.

Move centroids and assignments until within-cluster distance stops improving.

Best fit

Where this model earns its place

Exploratory segmentation

Start with a simpler baseline then compare this model using the same evaluation split and operational constraints.

Vector grouping

Start with a simpler baseline then compare this model using the same evaluation split and operational constraints.

Prototype discovery

Start with a simpler baseline then compare this model using the same evaluation split and operational constraints.

Strengths and limits

Trade-offs matter more than popularity.

Strengths

✓ Fast

✓ Simple

✓ Scales well

Limitations

△ Needs k

△ Sensitive to scale/outliers

△ Assumes roughly spherical clusters

Evaluation

Metrics to watch

SilhouetteInterpret with the product objective and error cost.
InertiaInterpret with the product objective and error cost.
StabilityInterpret with the product objective and error cost.
Production checklist

Before it reaches real users

  1. 01

    Normalize features

    Document the assumption and instrument the condition so regressions can be detected.

  2. 02

    Run multiple initializations

    Document the assumption and instrument the condition so regressions can be detected.

  3. 03

    Check segment usefulness

    Document the assumption and instrument the condition so regressions can be detected.