# K-medians clustering computation

Is there a built-in function for data clustering using k-medians algorithm? I found out about the ClusterDissimilarityFunction of the FindCLusters function, but I guess it refers to the distance function (mean for euclidean, median for manhattan etc). So my kmeans using manhattan metric looks like this:

FindClusters[Transpose[{height, weight}], 2,
Method -> {"KMeans", ClusterDissimilarityFunction -> "Median",
"InitialCentroids" -> {{0, 0}, {100, 100}}}]


Is it correct? How to compute k-medians?

• If it can't be done with the built-in functions, you could take the implementation of k-means from here and replace Mean with Median. That should do it. – C. E. Jan 12 '19 at 22:54