这是我的代码:
from skopt import BayesSearchCV
import warnings
warnings.filterwarnings('ignore', message='The objective has been evaluated at this point before.')
params={'min_child_weight': (0, 50,),
'max_depth': (0, 10),
'subsample': (0.5, 1.0),
'colsample_bytree': (0.5, 1.0),
#'reg_lambda':(1e-5,100,'log-uniform'),
#'reg_alpha':(1e-5,100,'log-uniform'),
'learning-rate':(0.01,0.2,'log-uniform')
}
bayes=BayesSearchCV(xgb.XGBRegressor(),params,n_iter=10,scoring='neg_mean_squared_error',cv=5,random_state=42)
res=bayes.fit(X_train,y_train)
print(res.best_params_)
我的程序只有在我评论这三个参数时才会运行,但是如果我让它们处于活动状态,它会给我错误:
ValueError: Not all points are within the bounds of the space.
我怎么还能包含这个参数,它拒绝接受它的原因是什么?