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

fail on import of spectral_embedding_ #20

Open
steelec opened this issue Mar 2, 2022 · 2 comments
Open

fail on import of spectral_embedding_ #20

steelec opened this issue Mar 2, 2022 · 2 comments

Comments

@steelec
Copy link
Contributor

steelec commented Mar 2, 2022

We were testing your package out and noted that it works with some versions of sklearn but not others. This appears to be due to the import statement in embed.py included below. I have not had a lot of time to track it down, but I think direct importing of these functions was removed in sklearn v .24 forward?

>> from sklearn.manifold.spectral_embedding_ import _graph_is_connected

FutureWarning: The sklearn.manifold.spectral_embedding_ module is  deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.manifold. Anything that cannot be imported from sklearn.manifold is now part of the private API.
  warnings.warn(message, FutureWarning)

https://github.com/satra/mapalign/blob/907d6c443e099fdb282996c1768c895eb13f300f/mapalign/embed.py#L73

@satra
Copy link
Collaborator

satra commented Mar 2, 2022

given python, i don't think they can make things really private. but the module name changed from sklearn.manifold.spectral_embedding_ to sklearn.manifold._spectral_embedding (https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/manifold/_spectral_embedding.py). we may have to try both imports to account for pre and post versions, or simply change it the latter and require sklearn 1.0 or greater (perhaps better).

do you think you could send a PR for this ?

@steelec
Copy link
Contributor Author

steelec commented Mar 2, 2022

Hopefully this is what you meant, PR here #21

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