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

Conform to new sklearn api #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

icfly2
Copy link

@icfly2 icfly2 commented Dec 9, 2020

Made import compliant with newer API as per warning:

  File "/app/model/model.py", line 3, in <module>
    import eli5
  File "/usr/local/lib/python3.7/site-packages/eli5/__init__.py", line 13, in <module>
    from .sklearn import explain_weights_sklearn, explain_prediction_sklearn
  File "/usr/local/lib/python3.7/site-packages/eli5/sklearn/__init__.py", line 21, in <module>
    from . import transform as _
  File "/usr/local/lib/python3.7/site-packages/eli5/sklearn/transform.py", line 6, in <module>
    from sklearn.feature_selection.base import SelectorMixin  # type: ignore
  File "/usr/local/lib/python3.7/site-packages/sklearn/feature_selection/base.py", line 12, in <module>
    _raise_dep_warning_if_not_pytest(deprecated_path, correct_import_path)
  File "/usr/local/lib/python3.7/site-packages/sklearn/utils/deprecation.py", line 143, in _raise_dep_warning_if_not_pytest
    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.

Yes this breaks backward compatibility for sklearn but will allow eli5 to continue to work with the next version of sklearn 0.24

@jimbudarz
Copy link

As with #397, changing the requirements and setup to require sklearn >= 0.20 would maintain compatibility.

@icfly2
Copy link
Author

icfly2 commented Dec 9, 2020

sklearn version bump in requirements.txt and setup.py in #397

@codecov-io
Copy link

Codecov Report

Merging #398 (c211550) into master (017c738) will decrease coverage by 23.58%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master     #398       +/-   ##
===========================================
- Coverage   97.32%   73.74%   -23.59%     
===========================================
  Files          49       49               
  Lines        3142     3142               
  Branches      585      585               
===========================================
- Hits         3058     2317      -741     
- Misses         44      777      +733     
- Partials       40       48        +8     
Impacted Files Coverage Δ
eli5/sklearn/transform.py 94.28% <100.00%> (-5.72%) ⬇️
eli5/keras/gradcam.py 0.00% <0.00%> (-100.00%) ⬇️
eli5/xgboost.py 4.26% <0.00%> (-95.13%) ⬇️
eli5/formatters/image.py 5.47% <0.00%> (-94.53%) ⬇️
eli5/sklearn_crfsuite/explain_weights.py 7.40% <0.00%> (-92.60%) ⬇️
eli5/keras/explain_prediction.py 4.81% <0.00%> (-91.57%) ⬇️
eli5/lightgbm.py 4.27% <0.00%> (-90.60%) ⬇️
eli5/lightning.py 5.00% <0.00%> (-90.00%) ⬇️
eli5/formatters/as_dataframe.py 5.79% <0.00%> (-89.86%) ⬇️
eli5/ipython.py 11.42% <0.00%> (-88.58%) ⬇️
... and 17 more

@lopuhin
Copy link
Contributor

lopuhin commented Feb 10, 2021

Thanks you! This were merged in eli5-org/eli5#2 and released to PyPI with v0.11

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.

None yet

4 participants