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

ModuleNotFoundError and ImportError due to deprecated sklearn sub-modules #10

Open
ShaunFChen opened this issue Aug 31, 2021 · 0 comments

Comments

@ShaunFChen
Copy link

Hi,

I was trying to rerun the example, after doing:

from stacked_generalization.lib.stacking import FWLSRegressor

I got the following errors, for stacking.py and util.py:

ModuleNotFoundError: No module named 'sklearn.cross_validation'
ImportError: cannot import name 'joblib' from 'sklearn.externals' 

According to https://stackoverflow.com/questions/30667525/importerror-no-module-named-sklearn-cross-validation and https://stackoverflow.com/questions/61893719/importerror-cannot-import-name-joblib-from-sklearn-externals, it seems to be related to the deprecation of sub-modules. It worked for me to replace all the:

from sklearn.cross_validation import StratifiedKFold, KFold
from sklearn.externals import joblib

by

from sklearn.model_selection import StratifiedKFold, KFold
import joblib

Thanks.

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

1 participant