automl / HPOlibConfigSpace

GNU General Public License v3.0
8 stars 10 forks source link

create configuration from HPOlib pkl #8

Open aaronkl opened 9 years ago

aaronkl commented 9 years ago

I want to create configuration from a HPOlib-pkl-file :

hpolib_pkl = cPickle.load(open(path_to_pkl,"r")) config = configuration_space.Configuration(config_space, hpolib_pkl["trials"][0]["params"])

But it crashes with the error message:

Value 1.0, <type 'str'> for instantiation of hyperparameter 'random_forest:max_features, Type: UniformFloat, Range: [0.5, 5.0], Default: 1' is not a legal value

Did I miss something? Are the dictionaries for a parameter instantiation created by HPOlib in a different format than HPOlibConfigSpace expects?

The HPOlib dictionary looks as follows:

In [350]: hpolib_pkl["trials"][0]["params"] Out[350]: OrderedDict([('classifier', 'random_forest'), ('imputation:strategy', 'mean'), ('preprocessor', 'None'), ('random_forest:bootstrap', 'True'), ('random_forest:criterion', 'gini'), ('random_forest:max_depth', 'None'), ('random_forest:max_features', '1.0'), ('random_forest:max_leaf_nodes', 'None'), ('random_forest:min_samples_leaf', '1'), ('random_forest:min_samples_split', '2'), ('random_forest:n_estimators', '100'), ('rescaling:strategy', 'min/max')])

mfeurer commented 9 years ago

Yes, the dictionaries created by the HPOlib are in a different format than the HPOlibConfigSpace expects. Why? Because no one did an update of the HPOlib so far. Possible remedies: