kmedoids usando Pycluster con varias funciones de distancia

I am using python 2.6 for windows. I am working on OpenCv core module. I search around about the kmedoids function defined in Pycluster, but did not get the accurate answer.

I have installed Pycluster 1.50 in windows7. Can somebody explain how to use Eucledian diatnce, L1 and L2 distance, hellinger distance and Chi-square distance using kmedoids?

Through searching I know so far.

import Pycluster
from Pycluster import distancematrix, kmedoids

The kmedoid function takes four arguments (as mentioned below), among them one is a distance. But I am unable to understand how to specify different distance measures in kmedoids function

clusterid, error, nfound = kmedoids (distance, nclusters=2, npass=1, initialid=None)

Any help regarding the matter would be highly encouraged

preguntado el 03 de mayo de 12 a las 12:05

Need your help. How did you install Pycluster in Windows ? -

2 Respuestas

As Shambool points out, the documentation gives you the answer. You don't pass a distance function directly, you pass a pairwise distance matrix. So compute that first, with whatever distance metric you want and then pass it along to kmedoids

contestado el 03 de mayo de 12 a las 15:05

It seems you didn't even bother to look at the documentación, on pages 28-29 this is clearly explained.

contestado el 03 de mayo de 12 a las 14:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.