Optimization 运行贝叶斯优化器,并在执行最大化功能时;其中一个下界大于一个上界。”;发生错误

Optimization 运行贝叶斯优化器,并在执行最大化功能时;其中一个下界大于一个上界。”;发生错误,optimization,parameters,bayesian,hyperparameters,Optimization,Parameters,Bayesian,Hyperparameters,我们正在运行用于超参数优化的贝叶斯优化器。顺便说一下,我得到了这个错误。即使尝试更改所有参数范围,也会出现相同的错误。请回答应该做什么 def XGB_cv(max_depth,learning_rate, n_estimators, gamma ,min_child_weight, max_delta_step, subsample ,colsample_bytree, silent=True, nthread=-1): model = xgb.XGBCla

我们正在运行用于超参数优化的贝叶斯优化器。顺便说一下,我得到了这个错误。即使尝试更改所有参数范围,也会出现相同的错误。请回答应该做什么

def XGB_cv(max_depth,learning_rate, n_estimators, gamma
           ,min_child_weight, max_delta_step, subsample
       ,colsample_bytree, silent=True, nthread=-1):
model = xgb.XGBClassifier(max_depth=int(max_depth),
                          learning_rate=learning_rate,
                          n_estimators=int(n_estimators),
                          silent=silent,
                          nthread=nthread,
                          gamma=gamma,
                          min_child_weight=min_child_weight,
                          max_delta_step=max_delta_step,
                          subsample=subsample,
                          colsample_bytree=colsample_bytree)
RMSE = cross_val_score(model, train2, y, scoring='accuracy', cv=5).mean()
return RMSE

pbounds = {'max_depth': (5, 10),
      'learning_rate': (0, 0.5),
      'n_estimators': (50, 1000),
      'gamma': (1, 0.01),
      'min_child_weight': (0,10),
      'max_delta_step': (0, 0.1),
      'subsample': (0, 0.8),
      'colsample_bytree' :(0, 0.99),
      }

xgboostBO = BayesianOptimization(f = XGB_cv, pbounds = pbounds, verbose = 2, random_state = 1 )
xgboostBO.maximize(init_points=2, n_iter = 10, acq='ei', xi=0.01)


~\Anaconda3\lib\site-packages\scipy\optimize\lbfgsb.py in _minimize_lbfgsb(fun, x0, args, jac, bounds, disp, maxcor, ftol, gtol, eps, maxfun, maxiter, iprint, callback, maxls, finite_diff_rel_step, **unknown_options)
292     # check bounds
293     if (new_bounds[0] > new_bounds[1]).any():
--> 294         raise ValueError("LBFGSB - one of the lower bounds is greater than an upper bound.")
295 
296     # initial vector must lie within the bounds. Otherwise ScalarFunction and
ValueError: LBFGSB - one of the lower bounds is greater than an upper bound.

我对这种贝叶斯方法一无所知,但在框有界优化中,提供大于上界的下界是不可能的:

"gamma":(1,0.01)

不确定这是否是你的问题,但我花了7秒钟才看到