1
$\begingroup$

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?

$\endgroup$
1
  • 4
    $\begingroup$ 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. $\endgroup$
    – C. E.
    Commented Jan 12, 2019 at 22:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.