Hyperopt: simple way to retrieve parameter value (and not index) when using hp.choice

Created on 28 Mar 2018  路  3Comments  路  Source: hyperopt/hyperopt

Hello,
So i've been using hyperopt for a while now, and I still cannot figure out a nice way to retrieve the actual parameter value from Trials items.
For example, fmin() returns the argmin dict of the Trials losses. The values stored for each parameter sampled from hp.choice is the index of the choice list.
Is there any way to directly access the parameter value?
Thanks,
Pierre

Most helpful comment

Use space_eval
space_eval(<search_space>, trials.argmin)

Alternatively, you can add the raw parameter values to the results dictionary from your fmin function

All 3 comments

Use space_eval
space_eval(<search_space>, trials.argmin)

Alternatively, you can add the raw parameter values to the results dictionary from your fmin function

thanks a lot, very helpful!

Hi,
keep in mind that space_eval has a bug: https://github.com/hyperopt/hyperopt/issues/383

Was this page helpful?
0 / 5 - 0 ratings