smac.runhistory.encoder.abstract_encoder

Classes

AbstractRunHistoryEncoder(scenario[, ...])

Abstract class for preparing data in order to train a surrogate model.

Interfaces

class smac.runhistory.encoder.abstract_encoder.AbstractRunHistoryEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]

Bases: object

Abstract class for preparing data in order to train a surrogate model.

Parameters:
  • scenario (Scenario object.)

  • considered_states (list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT] # noqa: E501) – Trials with the passed states are considered.

  • lower_budget_states (list[StatusType], defaults to []) – Additionally consider all trials with these states for budget < current budget.

  • scale_percentage (int, defaults to 5) – Scaled y-transformation use a percentile to estimate distance to optimum. Only used in some sub-classes.

  • seed (int | None, defaults to none)

Raises:

TypeError – If no success states are given.

get_configurations(budget_subset=None)[source]

Returns vector representation of the configurations.

Warning

Instance features are not appended and cost values are not taken into account.

Parameters:

budget_subset (list[int|float] | None, defaults to none) – List of budgets to consider.

Returns:

configs_array

Return type:

np.ndarray

property meta: dict[str, Any]

Returns the meta-data of the created object.

Returns:

  • dict[str, Any] (meta-data of the created object: name, considered states, lower budget)

  • states, scale_percentage, seed.

property multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None

The multi objective algorithm used to transform the data.

property runhistory: RunHistory

The RunHistory used to transform the data.

transform(budget_subset=None)[source]

Returns a vector representation of the RunHistory.

Parameters:

budget_subset (list | None, defaults to none) – List of budgets to consider.

Return type:

tuple[ndarray, ndarray]

Returns:

  • X (np.ndarray) – Configuration vector and instance features.

  • Y (np.ndarray) – Cost values.

abstract transform_response_values(values)[source]

Transform function response values.

Parameters:

values (np.ndarray) – Response values to be transformed.

Returns:

transformed_values

Return type:

np.ndarray