Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有办法访问 hyperopt 为参数选择的当前值?我想在 xgboost 的学习率回调函数中使用它选择的值。
from hyperopt import hp param = {'eta' : hp.uniform('eta', 0.01, 0.1)} # learning rate param['eta'] # returns <hyperopt.pyll.base.Apply at 0x23fd5699dd8>
使用fmin时,您将获得目标函数每次迭代的 'eta' 值。
例如
_ = fmin(fn=objective, space=param, max_evals=num_trials)
目标定义为:
def objective(params: Dict): # So you can access params['eta'] in this context