smac.facade.smac_facade module

class smac.facade.smac_facade.SMAC(scenario: smac.scenario.scenario.Scenario, tae_runner: typing.Union[smac.tae.execute_ta_run.ExecuteTARun, typing.Callable] = None, runhistory: smac.runhistory.runhistory.RunHistory = None, intensifier: smac.intensification.intensification.Intensifier = None, acquisition_function: smac.optimizer.acquisition.AbstractAcquisitionFunction = None, acquisition_function_optimizer: smac.optimizer.ei_optimization.AcquisitionFunctionMaximizer = None, model: smac.epm.base_epm.AbstractEPM = None, runhistory2epm: smac.runhistory.runhistory2epm.AbstractRunHistory2EPM = None, initial_design: smac.initial_design.initial_design.InitialDesign = None, initial_configurations: typing.List[ConfigSpace.configuration_space.Configuration] = None, stats: smac.stats.stats.Stats = None, restore_incumbent: ConfigSpace.configuration_space.Configuration = None, rng: typing.Union[mtrand.RandomState, int] = None, smbo_class: smac.optimizer.smbo.SMBO = None, run_id: int = 1)[source]

Bases: object

Facade to use SMAC default mode

logger
stats

Stats

solver

SMBO

runhistory

RunHistory – List with information about previous runs

trajectory

list – List of all incumbents

Constructor

Parameters:
get_X_y()[source]

Simple interface to obtain all data in runhistory in X, y format.

Uses smac.runhistory.runhistory2epm.AbstractRunHistory2EPM.get_X_y().

Returns:
  • X (numpy.ndarray) – matrix of all configurations (+ instance features)
  • y (numpy.ndarray) – vector of cost values; can include censored runs
  • cen (numpy.ndarray) – vector of bools indicating whether the y-value is censored
get_runhistory()[source]
Returns the runhistory (i.e., all evaluated configurations and
the results).
Returns:Runhistory
Return type:smac.runhistory.runhistory.RunHistory
get_tae_runner()[source]

Returns target algorithm evaluator (TAE) object which can run the target algorithm given a configuration

Returns:TAE
Return type:smac.tae.execute_ta_run.ExecuteTARun
get_trajectory()[source]

Returns the trajectory (i.e., all incumbent configurations over time).

Returns:Trajectory
Return type:List of TrajEntry
optimize()[source]

Optimizes the algorithm provided in scenario (given in constructor)

Returns:incumbent – Best found configuration
Return type:Configuration
validate(config_mode='inc', instance_mode='train+test', repetitions=1, use_epm=False, n_jobs=-1, backend='threading')[source]

Create validator-object and run validation, using scenario-information, runhistory from smbo and tae_runner from intensify

Parameters:
  • config_mode (str or list<Configuration>) –

    string or directly a list of Configuration str from [def, inc, def+inc, wallclock_time, cpu_time, all]

    time evaluates at cpu- or wallclock-timesteps of: [max_time/2^0, max_time/2^1, max_time/2^3, …, default] with max_time being the highest recorded time
  • instance_mode (string) – what instances to use for validation, from [train, test, train+test]
  • repetitions (int) – number of repetitions in nondeterministic algorithms (in deterministic will be fixed to 1)
  • use_epm (bool) – whether to use an EPM instead of evaluating all runs with the TAE
  • n_jobs (int) – number of parallel processes used by joblib
  • backend (string) – what backend to be used by joblib
Returns:

runhistory – runhistory containing all specified runs

Return type:

RunHistory