GithubHelp home page GithubHelp logo

Comments (26)

sauln avatar sauln commented on April 30, 2024 1

can't actually reproduce it myself

@arnaudmiribel and @amirsani, What system are you are using? Operating system w/ version and Python version.

We might be able add to add them to the Travis CI test runs. Currently, it's a little sparse running only on conda with 3.6 and 2.7.

from umap.

 avatar commented on April 30, 2024 1

Is this specific to Jupyter notebooks? I am on Ubuntu 16.04, python 3.5.2.

import umap
from sklearn.datasets import load_digits
#from scipy.sparse.csgraph import connected_components

digits = load_digits()

embedding = umap.UMAP(n_neighbors=5,
                      min_dist=0.3,
                      metric='correlation').fit_transform(digits.data)

The code above works if I start python from the command line, but doesn't work in a Jupyter notebook. If i uncomment the import it works in the notebook.

from umap.

amirsani avatar amirsani commented on April 30, 2024 1

Hello,

Yes. I was running on a Jupyter Notebook with Python 3.6.4 and Ubuntu 17.10.

from scipy.sparse.csgraph import connected_components
is all I had to add to umap_.py to get it working.

I installed umap-learn on my other system without any problems. I accidentally installed umap, as I did the first time, and wondered if this was causing any problems? I removed it and reinstalled umap-learn to get everything working on the other system.

from umap.

gforsyth avatar gforsyth commented on April 30, 2024 1

I can confirm that I just ran into this using SciPy 1.0.0 and @wflynny has identified the fix for the compatibility regression.
If the preference is for the smallest change, I think adding in a
import scipy.sparse.csgraph
will do the trick (as a stopgap until SciPy 1.0.1 is released)

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024 1

Thanks @wflynny and @gforsyth That looks like it is the source of the issue. I believe I added the relevant import in master, but hadn't rolled out a pip release yet. I'll try to get that done tonight and hopefully people will be seeing fewer issues.

from umap.

gokceneraslan avatar gokceneraslan commented on April 30, 2024 1

You can maybe exclude scipy==1.0 in setup.py.

from umap.

wangchuan2008888 avatar wangchuan2008888 commented on April 30, 2024 1

Scipy 1.1.0 has release, so in ubuntu python 3.6.4 just
pip install -U scipy
scipy 1.1.0 installed, problem sloved!

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

I am a little puzzled by this -- scipy >= 0.19 does have that module according to the docs:

from umap.

amirsani avatar amirsani commented on April 30, 2024

I agree, the following works fine:
from scipy.sparse.csgraph import connected_components

If I add the following,
from scipy.sparse.csgraph import connected_components
before,
def spectral_layout(graph, dim, random_state):
It works fine.

Probably my install is messed up.

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

It could be an issue in how some commits got merged in. I'll take a look soon just in case.

from umap.

amirsani avatar amirsani commented on April 30, 2024

from umap.

arnaudmiribel avatar arnaudmiribel commented on April 30, 2024

I have the same issue. Sorry, could you elaborate a little more on the solution that worked for you guys ?

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

My understanding is that you should edit the file umap_.py to have

from scipy.sparse.csgraph import connected_components

Along with the other imports. In practice it may be worth grabbing the latest version on master here and installing from that (after uninstalling the pip version). That should fix this issue, but as I can't actually reproduce it myself I can't know for sure.

from umap.

arnaudmiribel avatar arnaudmiribel commented on April 30, 2024

Thanks @lmcinnes, that trick indeed worked for me :)

from umap.

sauln avatar sauln commented on April 30, 2024

Thanks for the info. Sounds like it could be Jupyter or Ubuntu related.

One more question for both of you, are you using conda or pip to install everything?

from umap.

amirsani avatar amirsani commented on April 30, 2024

pip install umap-learn

from umap.

wflynny avatar wflynny commented on April 30, 2024

This looks like it's related to SciPy version 1.0.0. I assume it's working for SciPy version =< 0.19.

I currently have SciPy version 1.0.0 (released October 25, 2017) installed via conda/pip and I also have this problem. This commit to SciPy a month ago adds back the import of csgraph to scipy.sparse but there hasn't been a new release of SciPy since.

It might be best to directly import from scipy.sparse.csgraph import connected_components as suggested.

from umap.

arnaudmiribel avatar arnaudmiribel commented on April 30, 2024

@sauln I am using OSX High Sierra 10.13.2 and Python 3.6.4 (Anaconda, Inc)

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

New version now on PyPI should fix this. 0.2.1 or greater is what you should need if you are currently seeing this issue.

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

@gokceneraslan Sounds like a reasonable plan ... I'm just not sure how to do that as I'm not much of an expert on packaging and the required semantics for doing that within setup.py. I believe the current version of PyPI should fix it as is, so hopefully that will suffice.

from umap.

wflynny avatar wflynny commented on April 30, 2024

@lmcinnes I think you could do something like (according to PEP440):

'install_requires' : ['scikit-learn >= 0.16',
                      'scipy >= 0.19, !=1.0.0',
                      'numba >= 0.34'],

I've opened a PR.

from umap.

gforsyth avatar gforsyth commented on April 30, 2024

I mentioned this in #47 but I don't think excluding SciPy 1.0.0 is necessary and could make installation more of a headache. I think the import fix that @lmcinnes already made is sufficient.

from umap.

wflynny avatar wflynny commented on April 30, 2024

@gforsyth Fine by me, just giving @lmcinnes the option. The PR can sit open until newer versions of scipy are released. Or it can be closed.

from umap.

sleighsoft avatar sleighsoft commented on April 30, 2024

Did this get resolved?

from umap.

anshumankmr avatar anshumankmr commented on April 30, 2024

I was having the exact same issue with scipy.

module 'scipy.linalg' has no attribute 'decomp'

from umap.

lmcinnes avatar lmcinnes commented on April 30, 2024

It should be resolved with the latest versions of scipy. Not sure why there are any lingering issues.

from umap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.