ConfigSelector(scenario, *[, retrain_after, ...])

The config selector handles the surrogate model and the acquisition function.


class smac.main.config_selector.ConfigSelector(scenario, *, retrain_after=8, retries=16, min_trials=1)[source]

Bases: object

The config selector handles the surrogate model and the acquisition function. Based on both components, the next configuration is selected.

  • retrain_after (int, defaults to 8) – How many configurations should be returned before the surrogate model is retrained.

  • retries (int, defaults to 8) – How often to retry receiving a new configuration before giving up.

  • min_trials (int, defaults to 1) – How many samples are required to train the surrogate model. If budgets are involved, the highest budgets are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for the highest budget, we will use trials of a lower budget instead.


This method returns the next configuration to evaluate. It ignores already processed configurations, i.e., the configurations from the runhistory, if the runhistory is not empty. The method (after yielding the initial design configurations) trains the surrogate model, maximizes the acquisition function and yields n configurations. After the n configurations, the surrogate model is trained again, etc. The program stops if retries was reached within each iteration. A configuration is ignored, if it was used already before.


When SMAC continues a run, processed configurations from the runhistory are ignored. For example, if the intitial design configurations already have been processed, they are ignored here. After the run is continued, however, the surrogate model is trained based on the runhistory in all cases.


next_config – The next configuration to evaluate.

Return type:


property meta: dict[str, Any]

Returns the meta data of the created object.