k-medoids / PAM
What it is
Like k-means but with actual data points as centres, so any distance metric works and it resists outliers.
When to use it
Categorical or mixed data, or when outliers are meaningful and must not drag centroids.
Caveats
Classic PAM is far slower than k-means, with each swap step costing roughly quadratic time in the number of points. You still have to choose k, and like k-means it can settle in a local optimum.
Key ideas
- Cluster centres are actual data points (medoids), not averages
- Works with any dissimilarity measure, not just Euclidean distance
- Less sensitive to outliers than k-means
Related architectures
Original paper
Clustering by means of medoids (1987, publisher)