machine-learningcluster-analysisdata-miningelkioptics-algorithm

ELKI OPTICS pre-computed distance matrix


I can't seem to get this algorithm to work on my dataset, so I took a very small subset of my data and tried to get it to work, but that didn't work either.

I want to input a precomputed distance matrix into ELKI, and then have it find the reachability distance list of my points, but I get reachability distances of 0 for all my points.

ID=1 reachdist=Infinity predecessor=1
ID=2 reachdist=0.0 predecessor=1
ID=4 reachdist=0.0 predecessor=1
ID=3 reachdist=0.0 predecessor=1

My ELKI arguments were as follows:

Running: -dbc DBIDRangeDatabaseConnection -idgen.start 1 -idgen.count 4 -algorithm clustering.optics.OPTICSList -algorithm.distancefunction external.FileBasedDoubleDistanceFunction -distance.matrix /Users/jperrie/Documents/testfile.txt -optics.epsilon 1.0 -optics.minpts 2 -resulthandler ResultWriter -out /Applications/elki-0.7.0/elkioutputtest

I use the DBIDRangeDatabaseConnection instead of an input file to create indices 1 through 4 and pass in a distance matrix with the following format, where there are 2 indices and a distance on each line.

1 2 0.0895585119724274
1 3 0.19458931684494
2 3 0.196315720677376
1 4 0.137940123677254
2 4 0.135852232575417
3 4 0.141511023044586

Any pointers to where I'm going wrong would be appreciated.


Solution

  • When I change your distance matrix to start counting at 0, then it appears to work:

    ID=0 reachdist=Infinity predecessor=-2147483648
    ID=1 reachdist=0.0895585119724274 predecessor=-2147483648
    ID=3 reachdist=0.135852232575417 predecessor=1
    ID=2 reachdist=0.141511023044586 predecessor=3
    

    Maybe you should file a bug report - to me, this appears to be a bug. Also, predecessor=-2147483648 should probably be predecessor=None or something like that.