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

Incorrect references to sklearn? #47

Closed
mgandaman opened this issue Jan 26, 2021 · 8 comments · Fixed by #48
Closed

Incorrect references to sklearn? #47

mgandaman opened this issue Jan 26, 2021 · 8 comments · Fixed by #48
Milestone

Comments

@mgandaman
Copy link

Hello,

I have rfpimp ver 1.3.6 installed as well as sklearn 0.24.1. When I ran a script that used them, I got this error
File "C:...\anaconda3\envs...\lib\site-packages\rfpimp.py", line 16, in
from sklearn.ensemble.forest import _generate_unsampled_indices
ModuleNotFoundError: No module named 'sklearn.ensemble.forest'

I dug into it and found that sklearn.ensemble.forest is, in my version, sklearn.ensemble._forest and _generate_unsampled_indices does reside there.
While it's possible that something is wrong on my end, my guess is that sklearn has changed? I may change rfpimp.py on my own to match sklearn. I hope it doesn't break my computer. Thanks!

@parrt
Copy link
Owner

parrt commented Jan 26, 2021

Hi. Yep. I gotta do a version check in the code. thanks!

@huanfachen
Copy link

huanfachen commented Jan 28, 2021

According to this discussion:

The sklearn.ensemble.forest 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.ensemble. Anything that cannot be imported from sklearn.ensemble is now part of the private API.

I tested with rfpimp 1.3.2, it doesn't work with sklearn 0.24 as it requires from sklearn.ensemble.forest import _generate_unsampled_indices.

Does the lastest rfpimp (v.1.3.6) work with sklearn 0.22?

@parrt
Copy link
Owner

parrt commented Jan 28, 2021

I will have do some checking on the various versions... sorry for the hassle

@parrt
Copy link
Owner

parrt commented Jan 28, 2021

I think the issue is that 0.22 required two arguments and not three but it still used:

       from sklearn.ensemble.forest import _get_n_samples_bootstrap

but 0.24 is going to move that module. 0.23 is working for me at the moment but I will try to back up to 0.22 and see if it still works with rfpimp 1.3.6. Yep that works. I am unable to roll back to 0.21.3 however with pip so I'm not sure about 0.21. So, yes, it does work with 0.22, @huanfachen.

@parrt parrt mentioned this issue Jan 28, 2021
@parrt parrt closed this as completed in #48 Jan 28, 2021
@parrt parrt added this to the 1.3.7 milestone Jan 28, 2021
@huanfachen
Copy link

I think the issue is that 0.22 required two arguments and not three but it still used:

       from sklearn.ensemble.forest import _get_n_samples_bootstrap

but 0.24 is going to move that module. 0.23 is working for me at the moment but I will try to back up to 0.22 and see if it still works with rfpimp 1.3.6. Yep that works. I am unable to roll back to 0.21.3 however with pip so I'm not sure about 0.21. So, yes, it does work with 0.22, @huanfachen.

Thanks @parrt . Sorry for my typo in my msg.

I confirm that rfpimp 1.3.2 works with sklearn v0.22 but not with sklearn v0.24.

@parrt
Copy link
Owner

parrt commented Jan 29, 2021

Ok, please try 1.3.7 rfpimp. should work for you now.

@huanfachen
Copy link

@parrt I saw that 1.3.7 rfpimp is on pip but not conda-forge. Is it possible to upload it to conda-forge?

@parrt
Copy link
Owner

parrt commented Jan 31, 2021

hi. sorry. a single source is best.

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

Successfully merging a pull request may close this issue.

3 participants