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

Update scikit-learn imports #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

farhadmd7
Copy link

@farhadmd7 farhadmd7 commented Sep 3, 2024

Hi,
I want to use your interesting approach in the package but the last scikit learn version which supported
from sklearn.neighbors import DistanceMetric is according to the docs officially 0.24. (from 2021-22)
DistanceMetric has to instead be imported from sklearn.metrics

With regards to reproducibility of notebooks:

after making these changes in this commit I could reproduce the Swissroll Example.ipynb notebook but not the Line Example.ipynb.

and got following error:
Screenshot 2024-09-03 at 13 32 13

There because of old implementation of pygsp, in line causes the scipy to throw this line

as a workaround in this commit
I used sklrean to create a radius-based nearest neighbors graph that I believe matches what pygsp.graphs.NNGraph construct to avoid said issue

I wrapped the created graph with pygsp instance so it doesnt break the usage in the notebooks or in case someone using the dataset class

the produced outputs after these changes are very similar to what you have in the repository

if these changes aligens with what you meant to create with Line Dataset, it would greatly help me if you accept this PR.

@farhadmd7 farhadmd7 changed the title Fix import and notebook due to old version of scikit learn Update scikit-learn imports Sep 3, 2024
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

Successfully merging this pull request may close these issues.

1 participant