【发布时间】:2020-05-19 06:22:03
【问题描述】:
我正在关注在线超参数调整教程,我正在尝试使用bayes_opt,但我收到此错误:
---> best_params = bo.res['max']['max_params']
TypeError: list indices must be integers or slices, not str
这是我的示例代码:
from bayes_opt import BayesianOptimization
bo= BayesianOptimization(xgb_evaluate, {'max_depth': (3, 7),
'gamma': (0, 1),
'colsample_bytree': (0.3, 0.9)})
bo.maximize(init_points=3, n_iter=5, acq='ei')
best_params = bo.res['max']['max_params']
【问题讨论】:
标签: xgboost bayesian hyperparameters