1
$\begingroup$

The classical version of k-means uses the Euclidean distance in the first step, and the arithmetic mean (the value center) in the second step. Is k-means generalizable to other distances and other operations than the arithmetic mean so that it converges?

There are special cases like k-median, where the distance is city-block, and the center's value is the median of the cluster points.

$\endgroup$
6
  • $\begingroup$ Yes, you can use any distance metric that you prefer. Although you should be able to explain why you chose that particular metric. $\endgroup$ Commented Sep 2, 2020 at 12:54
  • $\begingroup$ Is it possible to choose any distance while setting the arithmetic mean as a choice in the second step? $\endgroup$ Commented Sep 2, 2020 at 12:57
  • $\begingroup$ Just to be clear, you can do it, however you will probably have to implement it yourself. I don't know of any which will let you choose. $\endgroup$ Commented Sep 2, 2020 at 13:10
  • $\begingroup$ I am looking for a general theoretical framework of the applicability of k-means over any distance while allowing k-means to converge. $\endgroup$ Commented Sep 2, 2020 at 13:13
  • $\begingroup$ Distance between what and what? Between data points or between a data point and a cluster centre? $\endgroup$
    – ttnphns
    Commented Sep 5, 2020 at 11:14

1 Answer 1

1
$\begingroup$

No, k-means is for euclidean distance. An alternative similar version of it is called k-medoids where centers are chosen amongst data points, and can be used with arbitrary distance metrics.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.