Describe the bug
I use Hierarchical Clustering with "upgmc" method (should be centroid based) but I get an exception.
In your repository I find code that lunch this exeption:
public int[] partition(double h) {
for (int i = 0; i < height.length - 1; i++) {
if (height[i] > height[i + 1]) {
throw new IllegalStateException("Non-monotonic cluster tree -- the linkage is probably not appropriate!");
}
}
...
With debugger I get internal clustering data before raising of the exception:
Heights
Describe the bug I use Hierarchical Clustering with "upgmc" method (should be centroid based) but I get an exception. In your repository I find code that lunch this exeption:
With debugger I get internal clustering data before raising of the exception: Heights
Merges:
Expected behavior I do not expect any exception.
Actual behavior Exception: java.lang.IllegalStateException: Non-monotonic cluster tree -- the linkage is probably not appropriate!
Code snippet
Input data
Additional context