smac.runhistory.encoder.abstract_encoder¶
Classes¶
|
Abstract class for preparing data in order to train a surrogate model. |
Interfaces¶
- class smac.runhistory.encoder.abstract_encoder.AbstractRunHistoryEncoder(scenario, considered_states=[<StatusType.SUCCESS: 1>, <StatusType.CRASHED: 3>, <StatusType.MEMORYOUT: 5>, <StatusType.DONOTADVANCE: 6>], lower_budget_states=[], scale_percentage=5, seed=None)[source]¶
Bases:
object
Abstract class for preparing data in order to train a surrogate model.
- Parameters:
scenario (Scenario) –
considered_states (list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT, StatusType.DONOTADVANCE] # 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(runhistory, budget_subset=None)[source]¶
Returns vector representation of the configurations. Instance features are not appended and cost values are not taken into account.
- Parameters:
runhistory (RunHistory) –
budget_subset (list | 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.
- Return type:
dict
[str
,Any
]
- property multi_objective_algorithm: smac.multi_objective.abstract_multi_objective_algorithm.AbstractMultiObjectiveAlgorithm | None¶
The multi objecctive algorithm used to transform the data.
- Return type:
Optional
[AbstractMultiObjectiveAlgorithm
]
- transform(runhistory, budget_subset=None)[source]¶
Returns a vector representation of the runhistory.
- Parameters:
runhistory (RunHistory) –
budget_subset (list | None, defauls 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.