smac.optimizer.epm_configuration_chooser module

class smac.optimizer.epm_configuration_chooser.EPMChooser(scenario: smac.scenario.scenario.Scenario, stats: smac.stats.stats.Stats, runhistory: smac.runhistory.runhistory.RunHistory, runhistory2epm: smac.runhistory.runhistory2epm.AbstractRunHistory2EPM, model: smac.epm.rf_with_instances.RandomForestWithInstances, acq_optimizer: smac.optimizer.ei_optimization.AcquisitionFunctionMaximizer, acquisition_func: smac.optimizer.acquisition.AbstractAcquisitionFunction, rng: numpy.random.mtrand.RandomState, restore_incumbent: Optional[ConfigSpace.configuration_space.Configuration] = None, random_configuration_chooser: smac.optimizer.random_configuration_chooser.RandomConfigurationChooser = <smac.optimizer.random_configuration_chooser.ChooserNoCoolDown object>, predict_x_best: bool = True, min_samples_model: int = 1)[source]

Bases: object

Interface to train the EPM and generate next configurations

Parameters
_collect_data_to_train_model() Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]
_get_evaluated_configs() List[ConfigSpace.configuration_space.Configuration][source]
_get_x_best(predict: bool, X: numpy.ndarray) Tuple[float, numpy.ndarray][source]

Get value, configuration, and array representation of the “best” configuration.

The definition of best varies depending on the argument predict. If set to True, this function will return the stats of the best configuration as predicted by the model, otherwise it will return the stats for the best observed configuration.

Parameters

predict (bool) – Whether to use the predicted or observed best.

Returns

  • float

  • np.ndarry

  • Configuration

choose_next(incumbent_value: Optional[float] = None) Iterator[ConfigSpace.configuration_space.Configuration][source]

Choose next candidate solution with Bayesian optimization. The suggested configurations depend on the argument acq_optimizer to the SMBO class.

Parameters

incumbent_value (float) – Cost value of incumbent configuration (required for acquisition function); If not given, it will be inferred from runhistory or predicted; if not given and runhistory is empty, it will raise a ValueError.

Returns

Return type

Iterator