when I retrieve Hyperopt trials with
my_trial = trials.trials[n]['misc']['vals']
I get a dictionary composed by lists each of single elements.
{ 'base_score': [0.5],
'colsample_bylevel': [0.5],
'colsample_bytree': [0.7000000000000001],
'learning_rate': [0.2],
'max_depth': [10.0],
'min_child': [80.0],
'min_split_loss': [0.8],
'n_estimators': [500.0],
'norm': [1],
'norm_norm': [2],
'quant_distr': [],
'scale': [3],
'scale_pos_w': [3.1],
'subsample': [0.8]}
However in order to use space_eval(space, my_trial) I need a dictionary where values are the elements of the lists above, not the lists.
Indeed when I retrieve the best trial with 'best' I obtain
{ 'base_score': 0.8,
'colsample_bylevel': 0.8,
'colsample_bytree': 0.5,
'learning_rate': 0.5,
'max_depth': 11.0,
'min_child': 90.0,
'min_split_loss': 0.4,
'n_estimators': 100.0,
'norm': 1,
'norm_norm': 2,
'scale': 3,
'scale_pos_w': 7.2,
'subsample': 0.5}
which is usable to instantiate the corresponding point in 'space' with
point = space_eval(space, my_trial)
I would like to transform the first dictionary into the second, with a simple direct instruction if at all possible
many thanks!