Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad argument for scipy.sparse.coo_matrix #10

Closed
MaximeBeauchene opened this issue Nov 13, 2017 · 6 comments
Closed

Bad argument for scipy.sparse.coo_matrix #10

MaximeBeauchene opened this issue Nov 13, 2017 · 6 comments

Comments

@MaximeBeauchene
Copy link

I want to use umap.UMAP().fit_transform(X) but i got an error :
ValueError: negative column index found
from the scipy function scipy.sparse.coo_matrix

When i have investigated, i've found in umap_.py, in the function fuzzy_simplicial_set(), the variable tmp_indices contains values < 0 (-1), but scipy.sparse.coo_matrix need values >= 0 !

Thx for answering me.

@lmcinnes
Copy link
Owner

Hi,

Thanks for tracking down the details. In summary the issue is the following: umap uses an approximate k-neighbor algorithm to find the n_neighbors points closest to each point. Apparently that algorithm has failed to find the full n_neighbors points (with the remaining neighbors set to a flag value of -1). As you note, this breaks a lot of stuff downstream in the code. First of all some better error checking so that a more sensible error message is displayed would be useful, so I'll try to get that done ASAP. After that it is a matter of tracking down why the approx knn algorithm is failing, which may take longer to sort out.

@lmcinnes
Copy link
Owner

I believe I have resolved the error, but would appreciate it if you could check if that is the case using the current master. Let me know if it works now, thanks!

@MaximeBeauchene
Copy link
Author

I have cloned your git :
git clone https://github.com/lmcinnes/umap.git

After i have done : python3 setup.py install
And i still have the same issue !

@MaximeBeauchene
Copy link
Author

The git log say the last commit is :

commit da6fe79
Author: Leland McInnes leland.mcinnes@gmail.com
Date: Mon Nov 13 11:46:01 2017 -0500

Match new calling convention better

5 hours before you answered me, have you push the fix ?

@lmcinnes
Copy link
Owner

I did indeed push the fix. I have found that I sometimes need to purge the previous version from my site-packages directory prior to a re-install before it takes. Could that be an issue?

@MaximeBeauchene
Copy link
Author

Thanks a lot !

It is working great.

Good job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants