pyclust
pyclust copied to clipboard
"ValueError: a must be greater than 0" in _kmeans_init np.random.choice
I am getting a ValueError: a must be greater than 0 after fitting my TFIDF matrix (shape = (19134, 179)). It's happening when _bisect_kmeans calls km.fit, and the error occurs in the _kmeans_init part of the code, where np.random.choice is being used.
I inserted print n_samples under the definition of n_samples in _kmeans_init, and I get this:
19134
19134
19134
19134
19134
19134
19134
19134
19134
19134
12765
12765
12765
12765
12765
12765
12765
12765
12765
12765
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
0
And then the error is raised.
I would need more information to figure out what the issue is. Can you reproduce this error somehow?