YingfanWang/PaCMAP

Error when the number of instances grow to large

Closed this issue · 2 comments

Hello below I showcase the line of the error & the error it self:

site-packages/pacmap/pacmap.py", line 462, in generate_pair
nbrs = np.zeros((n, n_neighbors_extra), dtype=np.int32)
TypeError: 'float' object cannot be interpreted as an integer

When the number of instances that I want to cluster grows too large (above 20k), the n_neighbors_extra becomes a float (e.g 67.321) and then I get the following error.
Locally, I escaped this error by casting the n_neighbors_extra as an int inside the function but I am not sure if for the quality of the solution this is a proper fix.

Thanks for reporting, I will work on a hotfix and report the progress in this thread.

I cannot reproduce this error locally with the MNIST dataset (70k instances). Would you be able to provide a short code snippet that may generate this error?