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

Future Warning Error #360

Open
dangbluechip opened this issue Jan 21, 2020 · 6 comments
Open

Future Warning Error #360

dangbluechip opened this issue Jan 21, 2020 · 6 comments

Comments

@dangbluechip
Copy link

Started receiving the following message after a few updates. Sklearn access in upcoming versions should only be through their public api.

FutureWarning: The sklearn.metrics.scorer 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.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning)

FutureWarning: The sklearn.feature_selection.base 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.feature_selection. Anything that cannot be imported from sklearn.feature_selection is now part of the private API. warnings.warn(message, FutureWarning)

@hermidalc
Copy link

I get the same too, it's because of upgrading to scikit-learn 0.22.x. You can suppress it like:

warnings.filterwarnings('ignore', category=FutureWarning,
                        module='sklearn.utils.deprecation')
# all ELI5 imports here
from eli5 import explain_weights, explain_prediction
warnings.filterwarnings('always', category=FutureWarning,
                        module='sklearn.utils.deprecation')

@lukeplausin
Copy link

I get this exception when using eli5 as installed from pypi

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/luke/.virtualenvs/myenv/lib/python3.8/site-packages/eli5/__init__.py", line 13, in <module>
    from .sklearn import explain_weights_sklearn, explain_prediction_sklearn
  File "/home/luke/.virtualenvs/myenv/lib/python3.8/site-packages/eli5/sklearn/__init__.py", line 3, in <module>
    from .explain_weights import (
  File "/home/luke/.virtualenvs/myenv/lib/python3.8/site-packages/eli5/sklearn/explain_weights.py", line 78, in <module>
    from .permutation_importance import PermutationImportance
  File "/home/luke/.virtualenvs/myenv/lib/python3.8/site-packages/eli5/sklearn/permutation_importance.py", line 15, in <module>
    from sklearn.metrics.scorer import check_scoring  # type: ignore
ModuleNotFoundError: No module named 'sklearn.metrics.scorer'

If anyone else got this error after using a fresh install of eli5, you can fix by running pip install "scikit-learn<=0.23.0" in your environment.
eli5 maintainers - you should set the scikit-learn dependency in requirements.txt or setup.py to scikit-learn<=0.23.0 until eli5 gets a proper update so that new users don't get a broken installation.

@michael135
Copy link

It's relevant not only for new user, but for every user, which occasionaly update scikit learn to its last version.

@arc12
Copy link

arc12 commented Jan 6, 2021

please fix this asap; it is not a fix to use an old version of sklearn which contains issues which are fixed in 0.24.
Keep on top of deprecation warnings!

PR is #397

@toltoxgh
Copy link

A fix so that eli5 could be used with scikit-learn 0.24 would be really appreciated, thanks.

@lopuhin
Copy link
Contributor

lopuhin commented Jan 13, 2021

Hi folks, sorry for lack of activity here, I really hope we can get all the fixes and hopefully some features merged in Jan, we need to also update the CI and do some other house-keeping.

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

7 participants