Skip to main content

Compare k-means, k-medoids, k-modes

Short answer

k-means uses mean (numeric, sensitive to outliers); k-medoids uses an actual object as medoid (robust to outliers, any dissimilarity, but slower O(k(n−k)²)); k-modes uses the mode for categorical data with matching dissimilarity. All three are partitioning methods that iteratively relocate objects.

Compare k-means, k-medoids, and k-modes algorithm.

All three are partitioning methods that form k clusters by iterative relocation, but they differ in the cluster representative and the type of data.

Basisk-meansk-medoids (PAM)k-modes
Cluster centreMean of the objects (may not be an actual object)Medoid: an actual, most central objectMode: the most frequent value of each attribute
Data typeNumeric (continuous)Numeric, and any type with a dissimilarity measureCategorical
DissimilarityEuclidean distanceAny distance (e.g. Manhattan)Number of mismatches between attribute values (simple matching)
ObjectiveMinimise sum of squared errorsMinimise sum of absolute dissimilarities to medoidsMinimise total mismatches to modes
Update stepRecompute meanSwap a medoid with a non-medoid if cost fallsRecompute mode of each attribute
Outliers/noiseVery sensitiveRobust (medoid is not shifted by outliers)Moderately robust
ComplexityO(nkt)O(k(n − k)²) per iteration, costly for big dataO(nkt), efficient
ScalabilityHighLow (CLARA/CLARANS for large data)High
ExampleCluster customers by (age, income)Cluster with outliers, e.g. house pricesCluster by (colour, make, city)

Summary: k-means is fast but sensitive to outliers; k-medoids is robust but slower; k-modes extends the k-means paradigm to categorical data by using modes and a matching dissimilarity (k-prototypes handles mixed data).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Mining chapter 5 questions →