【发布时间】:2020-08-19 01:47:27
【问题描述】:
我正在运行 XGBRegressor 和来自 skopt 的 BayesSearchCV 进行参数调整
opt_xgb_model_tuned = xgboost.XGBRegressor()
hyper_space = {
'booster': ['gbtree'],
'objective': ['reg:squarederror'],
'learning_rate': [0.005, 0.01, 'log-uniform'],
'max_depth': [8, 12],
'min_child_weight': [0, 10],
'gamma': [0.01, 10, 'log-uniform'],
'subsample': [0.0001, 1, 'uniform'],
'colsample_bytree': [0.001, 1.0, 'uniform'],
'reg_lambda': [0.01, 50, 'log-uniform'],
'reg_alpha': [0.001, 1, 'log-uniform'],
'max_delta_step': [0, 20],
'n_estimators': [500, 2000],
}
gs = BayesSearchCV(opt_xgb_model_tuned, hyper_space, n_iter=32, random_state=0)
gs_res = gs.fit(X_train, y_train)
c:\users\joel thomas wilson\anaconda_python\py2020\envs\optimus_prime\lib\site-packages\skopt\utils.py in check_x_in_space(x, space) 184 如果 is_2Dlistlike(x): 185 如果不是 np.all([p 在空间中的 p 在 x]): --> 186 raise ValueError("并非所有点都在范围内" 187“空间。”) 188 如果有的话([len(p) != len(space.dimensions) for p in x]):
ValueError:并非所有点都在空间范围内。
关于我们搜索每个参数的规则/范围的任何线索,是否取决于X 范围?就像我的模型目标在 [-1, 1] 的范围内。这和这个有关系吗?
【问题讨论】:
-
你有多少个变量?超过 1000 个?
标签: python xgboost hyperparameters skopt