SelfExplainML / PiML-Toolbox

PiML (Python Interpretable Machine Learning) toolbox for model development & diagnostics
https://selfexplainml.github.io/PiML-Toolbox
Apache License 2.0
931 stars 111 forks source link

scikit-learn 1.3.0 triggers "ImportError: cannot import name SCORERS" #43

Closed mikewilkerson-solas closed 1 year ago

mikewilkerson-solas commented 1 year ago

Hey PiML team—we at SolasAI just ran into this issue today: Now that scikit-learn 1.3.0 is out, it appears to cause an import error in piml/data/base.py.

Reproducing

python3.8 -m venv .venv
source .venv/bin/activate
pip install piml
python -c 'from piml import Experiment'

Stacktrace

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/mike-wilkerson/code/piml-test/.venv/lib/python3.8/site-packages/piml/__init__.py", line 1, in <module>
    from .api import Experiment
  File "piml/api.py", line 12, in init piml.api
  File "/home/mike-wilkerson/code/piml-test/.venv/lib/python3.8/site-packages/piml/dashboard/__init__.py", line 1, in <module>
    from .fairness_panel import FairnessPanel, FairnessComparePanel
  File "piml/dashboard/fairness_panel.py", line 11, in init piml.dashboard.fairness_panel
  File "/home/mike-wilkerson/code/piml-test/.venv/lib/python3.8/site-packages/piml/workflow/__init__.py", line 1, in <module>
    from .base import Model
  File "piml/workflow/base.py", line 10, in init piml.workflow.base
  File "piml/workflow/pipeline.py", line 10, in init piml.workflow.pipeline
  File "piml/data/base.py", line 7, in init piml.data.base
ImportError: cannot import name SCORERS

Temporary workaround

On a hunch, we checked to see if scikit-learn had been updated recently, and discovered that 1.3.0 was released on June 30. To temporarily work around this issue, we just used pip install scikit-learn==1.2.2 to roll back.

Misc info

OS: Ubuntu 20.04 Python version: 3.8

Please let us know if you need any more information!

ZebinYang commented 1 year ago

Hi @mikewilkerson-solas ,

Thank you for reporting this issue.

We will fix this dependency conflict accordingly in the next release.