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.
- with coords
-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);