# When to use K-Medoids instead of K-means

When it's better to use K-Medoids rather than K-Means? Can anybody give some examples of dataset for the same?

• From Wikipedia: It is more robust to noise and outliers as compared to k-means because it minimizes a sum of pairwise dissimilarities instead of a sum of squared Euclidean distances. Jul 9 '20 at 7:40
• You may also want to use K-medoid when you want the representers of the classes to be one of the points in your dataset. Ex : representer of a class of pictures of faces is a blurry picture for K-means and it is a real picture of someone's face in K-medoid, one of the exemples of the dataset.
– TMat
Jul 9 '20 at 8:00
• The question is similar to when to use median instead of mean. Check the answers here stats.stackexchange.com/questions/6913/… Mean is trying to minimize L2 loss and Median is trying to minimize L1 loss. stats.stackexchange.com/questions/34613/… Jul 9 '20 at 8:04