kmodes icon indicating copy to clipboard operation
kmodes copied to clipboard

Transform function

Open hajarhomayouni opened this issue 5 years ago • 4 comments

Does K-prototypes implement the transform function of k-means, which returns a distance matrix?

hajarhomayouni avatar Aug 15 '18 18:08 hajarhomayouni

Can you be more specific, @hajarhomayouni ?

nicodv avatar Aug 17 '18 20:08 nicodv

Sklearn K-means has a fit_transform function that transforms X to a cluster-distance space.
Is there a same function for k-prototypes?

hajarhomayouni avatar Aug 17 '18 20:08 hajarhomayouni

No, there's no transform method currently. KPrototypes would have to return both a dissimilarity matrix and a distance matrix then. Wouldn't be too hard to implement, I think.

What's your use case?

nicodv avatar Aug 17 '18 20:08 nicodv

I am trying to find local outliers in each cluster. So, I needed to calculate the distance between each data point to the corresponding cluster center. The transform function would give me the entire matrix, but now I need to calculate dissimilarity for each data point, which is not hard to implement.

Thanks.

hajarhomayouni avatar Aug 17 '18 20:08 hajarhomayouni