cave.utils.hpbandster2smac module

class cave.utils.hpbandster2smac.HpBandSter2SMAC[source]

Bases: object

convert(folder)[source]
get_incumbent_trajectory_for_budget(result, budget)[source]

Returns the best configurations over time

Parameters:
  • budget (string) – TODO
  • result (Result) – result object with runs
Returns:

dictionary with all the config IDs, the times the runs finished, their respective budgets, and corresponding losses

Return type:

dict

get_trajectory(result, output_path, scenario, rh, budget=None)[source]

If budget is specified, get trajectory for only that budget. Else use hpbandster’s averaging.

hpbandster2smac(result, cs: ConfigSpace.configuration_space.ConfigurationSpace, backup_cs, output_dir: str)[source]

Reading hpbandster-result-object and creating RunHistory and trajectory… treats each budget as an individual ‘smac’-run, creates an output-directory with subdirectories for each budget.

Parameters:
  • result (hpbandster.core.result.Result) – bohb’s result-object
  • cs (ConfigurationSpace) – the configuration space
  • backup_cs (List[ConfigurationSpace]) – if loading a configuration fails, try configspaces from this list until succeed
  • output_dir (str) – the output-dir to save the smac-runs to
load_configspace(folder)[source]

Will try to load the configspace. If it’s a pcs-file, backup_cs will be a list containing all possible combinations of interpretation for Categoricals. If this issue will be fixed, we can drop this procedure.