pyclustering icon indicating copy to clipboard operation
pyclustering copied to clipboard

clarans similarity instead of distance?

Open TyrandeWhisperwind opened this issue 5 years ago • 3 comments

Hello, is there a way to use similarity isntead of distance in CLARANS algorithm? if yes cud u show us where to add changes in ur code? and does it necessarily have to be a point of two coordinate? or the length of the tuple doesn't matter?

TyrandeWhisperwind avatar Apr 20 '19 15:04 TyrandeWhisperwind

Hello, @TyrandeWhisperwind ,

Euclidean distance is considered as a similarity between objects. What kind of similarity do you want to see? Currently, there is no way to specify another distance metric.

Point is considered as an abstract object, length of object can be from 1 to N, for example, data may looks like: X = [ [x11, x12, x13, ..., x1N], [x21, x22, x23, ..., x2N], ... [xM1n, xM2, xM3, ..., xMN]].

annoviko avatar Apr 22 '19 09:04 annoviko

Hi, thank you for your replay, I wanted to use "Pearson similarity", but I did change it to "Pearson distance" using this formula: https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/pear_dis.htm I did read your CLARANS code it seems like it can only use Euclidean distance, and it would be much more better if we could pass to your CLARANS code a distance matrix like you did with dbscan and kmedoids, but still it is a helpful code I can change it to make it use my pearson distance. Thank you so much for your contribution Andrei !

TyrandeWhisperwind avatar Apr 22 '19 10:04 TyrandeWhisperwind

@TyrandeWhisperwind, I will introduce opportunity to use specific metric for CLARANS algorithm in the next release - 0.9.1. Thank you for the issue!

  • [ ] Argument to specify distance metric for CLARANS algorithm.

annoviko avatar Apr 23 '19 09:04 annoviko