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?
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:
Try to cast all values in the hyperparameters dictionary to a float prior to instantiating the Configuration.
Add the possibility to instantiate a float hyperparameter from a string value
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')])