Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

TypeError: __init__() got an unexpected keyword argument 'iid' #987

@omkarudawant

Description

@omkarudawant

I'm facing an issue while initiating the BayesSearchCV object,

from sklearn.ensemble import RandomForestClassifier
from skopt import BayesSearchCV
from skopt.space import Real, Categorical, Integer

clf = RandomForestClassifier()

search_space = {
    "bootstrap": Categorical([True]), 
    "max_depth": Integer(6, 10),
    "max_features": Categorical(['auto', 'sqrt']),
    "min_samples_leaf": Integer(3, 5),
    "min_samples_split": Integer(4, 6),
    "n_estimators": Integer(100, 350)
}

clf_bayes = BayesSearchCV(
    estimator=clf,
    search_spaces=search_space,
    random_state=0,
    cv=3,
    verbose=2,
    n_jobs=-1
)

Traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-4b5d6a98a6c4> in <module>
      5     cv=3,
      6     verbose=2,
----> 7     n_jobs=-1
      8 )

C:\ProgramData\Miniconda3\envs\cuto\lib\site-packages\skopt\searchcv.py in __init__(self, estimator, search_spaces, optimizer_kwargs, n_iter, scoring, fit_params, n_jobs, n_points, iid, refit, cv, verbose, pre_dispatch, random_state, error_score, return_train_score)
    311              n_jobs=n_jobs, iid=iid, refit=refit, cv=cv, verbose=verbose,
    312              pre_dispatch=pre_dispatch, error_score=error_score,
--> 313              return_train_score=return_train_score)
    314 
    315     def _check_search_space(self, search_space):

C:\ProgramData\Miniconda3\envs\cuto\lib\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs)
     61             extra_args = len(args) - len(all_args)
     62             if extra_args <= 0:
---> 63                 return f(*args, **kwargs)
     64 
     65             # extra_args > 0

TypeError: __init__() got an unexpected keyword argument 'iid'

My Config:

OS: Win 10 Pro (19042.746)
scikit-learn==0.24.1
scikit-optimize==0.8.1

I don't know what's wrong, is anyone facing the same ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions