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

cannot import name '_check_fit_params' from 'sklearn.utils.validation' #273

Open
gilbertblanson opened this issue Dec 10, 2024 · 1 comment

Comments

@gilbertblanson
Copy link

  • Operating System: Windows 11
  • Python version: 3.10
  • summit version used: 0.8.9

Description

I was trying to run the Summit tutorial (https://gosummit.readthedocs.io/en/latest/tutorials/intro.html) locally on my computer, but ran into this issue when trying to import summit. I thought it might be an issue with my installation, so I tried it on the Colab, but it gave the same error.

What I Did

from summit import *
import matplotlib.pyplot as plt

ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 from summit import *
      2 import matplotlib.pyplot as plt

File [~\AppData\Local\anaconda3\envs\summit_env\lib\site-packages\summit\__init__.py:19](http://localhost:8888/~/AppData/Local/anaconda3/envs/summit_env/lib/site-packages/summit/__init__.py#line=18)
     17 from summit.domain import *
     18 from summit.experiment import *
---> 19 from summit.run import *
     20 from summit.strategies import *
     21 from summit.benchmarks import *

File [~\AppData\Local\anaconda3\envs\summit_env\lib\site-packages\summit\run.py:3](http://localhost:8888/~/AppData/Local/anaconda3/envs/summit_env/lib/site-packages/summit/run.py#line=2)
      1 from summit.strategies import Strategy, strategy_from_dict
      2 from summit.experiment import Experiment
----> 3 from summit.benchmarks import *
      4 from summit.utils.multiobjective import pareto_efficient, hypervolume
      5 from summit import get_summit_config_path

File [~\AppData\Local\anaconda3\envs\summit_env\lib\site-packages\summit\benchmarks\__init__.py:3](http://localhost:8888/~/AppData/Local/anaconda3/envs/summit_env/lib/site-packages/summit/benchmarks/__init__.py#line=2)
      1 from .snar import SnarBenchmark
      2 from .test_functions import Himmelblau, Hartmann3D, ThreeHumpCamel, DTLZ2, VLMOP2
----> 3 from .experimental_emulator import *
      4 from .MIT import *

File [~\AppData\Local\anaconda3\envs\summit_env\lib\site-packages\summit\benchmarks\experimental_emulator.py:36](http://localhost:8888/~/AppData/Local/anaconda3/envs/summit_env/lib/site-packages/summit/benchmarks/experimental_emulator.py#line=35)
     30 from sklearn.model_selection._validation import (
     31     _fit_and_score,
     32     _score,
     33     _aggregate_score_dicts,
     34 )
     35 from sklearn.metrics import r2_score
---> 36 from sklearn.utils.validation import (
     37     _deprecate_positional_args,
     38     indexable,
     39     check_is_fitted,
     40     _check_fit_params,
     41 )
     42 from sklearn.utils import check_array, _safe_indexing
     43 from sklearn.utils.fixes import delayed

ImportError: cannot import name '_check_fit_params' from 'sklearn.utils.validation' (~\AppData\Local\anaconda3\envs\summit_env\lib\site-packages\sklearn\utils\validation.py)
@gilbertblanson
Copy link
Author

Fixed it by downgrading scikit-learn from 1.6 to 1.3.2.

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