-
Notifications
You must be signed in to change notification settings - Fork 552
Issue on running Bayesian Search on decision tree #978
Comments
The newest version of scikit-learn has deprecated the |
Thanks, now it works. |
When do you anticipate supporting the newer version of sklearn? |
Monkey patch that solves this issue: def bayes_search_CV_init(self, estimator, search_spaces, optimizer_kwargs=None,
n_iter=50, scoring=None, fit_params=None, n_jobs=1,
n_points=1, iid=True, refit=True, cv=None, verbose=0,
pre_dispatch='2*n_jobs', random_state=None,
error_score='raise', return_train_score=False):
self.search_spaces = search_spaces
self.n_iter = n_iter
self.n_points = n_points
self.random_state = random_state
self.optimizer_kwargs = optimizer_kwargs
self._check_search_space(self.search_spaces)
self.fit_params = fit_params
super(BayesSearchCV, self).__init__(
estimator=estimator, scoring=scoring,
n_jobs=n_jobs, refit=refit, cv=cv, verbose=verbose,
pre_dispatch=pre_dispatch, error_score=error_score,
return_train_score=return_train_score)
BayesSearchCV.__init__ = bayes_search_CV_init |
Hi guys, please, is there a timeline for ironing out the incompatibility with the new scikit-learn? Thanks, MF |
* Remove BayesSearchCV(iid=) parameter deprecated in sklearn Fixes #978 * Remove now unused weights= parameter * Update skopt/searchcv.py Co-authored-by: Tim Head <betatim@gmail.com> * Fix BayesSearchCV repr/pprint; Fix changed sklearn.model_selection._validation._fit_and_score * Update searchcv.py Further improvements for kernc previous commits. iid totally removed to prevent troubles with sklearn utils prettyprinting. prettyprinting looks for params when print to repl. Sklearn 0.24 has changed return value after cv, so i changed dict destructuring(a litttle bit dirty) * Update searchcv.py * Revert unrelated changes * PEP8 format; add comment * Revert reverting "unrelated changes" This is required to pass tests/test_searchcv.py with scikit-learn 0.24+. * Migrate BayesSearchCV to sklearn BaseSearchCV._run_search() API Fixes #718 * add todo item * Add WhatsNew entry Co-authored-by: Tim Head <betatim@gmail.com> Co-authored-by: bole1 <bolenevod@yandex.ru>
@AyrtonB , with your Patch, the code is running infinitely. |
I am still having this issue. |
me too... |
It's working in most of my envs but not for the one using the latest skopt release, you may have to use an older release |
+1 |
But how to downgrade sklearn to that version? |
Maybe you have to uninstall scikit before, for me it was not needed. |
Doesn't work. Gives error:
|
@siddagra Seems like there might be a more fundamental problem in your case, because your error message even lists 0.23.2 as a supported version. |
It doesn't work at all |
I'm trying to run the BayesSearchCV on a decision tree but i found this error.
TypeError: __init__() got an unexpected keyword argument 'iid'
My code is:
with a simple dataset. Could you please help me? Thanks
The text was updated successfully, but these errors were encountered: