MerQuR+Statistics Glossary

Statistics Glossary → k-medoids (PAM)

k-medoids (PAM)concept

A clustering method that uses an actual observation in the cluster (the medoid) rather than the mean as each cluster's centre and builds the clusters by minimizing total distance.

k-means takes the cluster centre to be the cluster mean and minimizes squared Euclidean distance. k-medoids instead chooses, for each cluster, the actual observation whose total distance to the other observations in the cluster is smallest. Kaufman and Rousseeuw's PAM (Partitioning Around Medoids) algorithm first builds initial medoids (build) and then tries swapping each medoid with a non-medoid observation to see whether the total distance falls (swap).

Because the centre is a real observation it is easy to interpret ('this is the typical member of the cluster'), and extreme values cannot pull the centre towards themselves, so it is more robust to outliers than k-means. It can work with any distance measure (Manhattan, Gower and others). Its drawback is computational cost: it needs all pairwise distances, so it slows down on very large data sets. The number of clusters k must be set in advance.

An everyday example

A distribution company clusters 200 shops to place 5 depots. k-means may put a depot at the average coordinates of a cluster, sometimes in the middle of a lake; k-medoids instead picks one of the real shops in each cluster as the depot site. A single far-off shop outside the city does not drag the medoid towards it either.

In MerQur

The 'Algorithm (K-means / K-medoids (PAM))' option in K-Means Clustering; PAM uses an actual observation (the medoid) instead of a mean as the centre and is more robust to outliers.

Analyses where this concept appears

K-Means Clustering

Related concepts

Choosing the number of clustersDistance measure (Euclidean, Manhattan, Gower, great-circle)