cv = skms.check_cv(self.cv, y, classifier=skms.is_classifier(self.estimator))
self.scorer_ = skms.check_scoring(self.estimator, scoring=self.scoring)
pd = self.param_distributions
if self.optimizer is None:
dimensions = [pd[k] for k in sorted(pd.keys())]
self.optimizer = Optimizer(dimensions, GaussianProcessRegressor())
params = self.optimizer.ask()
params_dict = {k: v for k,v in zip(sorted(pd.keys()), params)}
cv_iter = list(cv.split(X, y, groups))
After Change
cv = skms.check_cv(self.cv, y, classifier=skms.is_classifier(self.estimator))
self.scorer_ = skms.check_scoring(self.estimator, scoring=self.scoring)
key = str(param_space)
if key not in self.optimizer:
self.optimizer[key] = self._make_optimizer(param_space)