how to create a CLARANS cluster using distance matrix?

155 views Asked by At

When I use CLARANS cluster with coordinates, then clustering is successful. When I try to write clustering with the distance matrix, then the points are grouped incorrectly. I use the haifengl/smile git repository, which has all the clusters I need. I attach a piece of code with a distance matrix and two .png files with clusters output. enter image description here- with coords enter image description here -with distance matrix

https://drive.google.com/open?id=1lKYQep_yppJP3rhY_n-vZIvKJDbcrfpj - distance matrix file

Integer[] integers = new Integer[data.length - 1];
Distance<Integer> distance = (x, y) -> data[x][y];            
CLARANS clarans = new CLARANS(integers, distance, defaultK);
0

There are 0 answers