I am using K-medoids to reduce my data (potential future scenarios of a stock’s price) from 400 scenarios to n = 25. I computed the distance matrix based on the Eucledian distance:
C = pairwise(Euclidean(), data', data')
where data
are my 400 scenarios - the data file can be found at link. Then I run K-medoids:
kmedoids(C, n, init = :kmpp)
I get the error:
ERROR: AssertionError: !(isempty(grp))
Does any of you know what could be wrong? It seems to run fine in Python (from sklearn_extra.cluster import KMedoids), but I guess the two K-medoids functions are different. I haven’t been able to find any documentation on why it fails…