smac.runhistory.encoder¶
Interfaces¶
- class smac.runhistory.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.
- class smac.runhistory.encoder.RunHistoryEIPSEncoder(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:
AbstractRunHistoryEncoder
Encoder specifically for the EIPS acquisition function.
- class smac.runhistory.encoder.RunHistoryEncoder(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:
AbstractRunHistoryEncoder
- class smac.runhistory.encoder.RunHistoryInverseScaledEncoder(*args, **kwargs)[source]¶
Bases:
RunHistoryEncoder
- class smac.runhistory.encoder.RunHistoryLogEncoder(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:
RunHistoryEncoder
- class smac.runhistory.encoder.RunHistoryLogScaledEncoder(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:
RunHistoryEncoder
- class smac.runhistory.encoder.RunHistoryRawEncoder(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:
RunHistoryEncoder
A transformer that transform the RunHistroy to vectors. This set of classes will return the raw cost values in addition to the transformed cost values. The raw cost values can then be applied for local BO approaches.
- transform_raw_values(values)[source]¶
Returns the raw input values before transformation.
- Return type:
ndarray
- transform_with_raw(runhistory, budget_subset=None)[source]¶
Returns vector representation of runhistory; if imputation is disabled, censored (TIMEOUT with time < cutoff) will be skipped. This function returns both the raw and transformed cost values
- Parameters:
runhistory (smac.runhistory.runhistory.RunHistory) – Runhistory containing all evaluated configurations/instances
budget_subset (list of budgets to consider) –
- Return type:
tuple
[ndarray
,ndarray
,ndarray
]- Returns:
X (numpy.ndarray) – configuration vector x instance features
Y (numpy.ndarray) – cost values
Y_raw (numpy.ndarray) – cost values before transformation
- class smac.runhistory.encoder.RunHistoryRawScaledEncoder(scenario, considered_states=[<StatusType.SUCCESS: 1>, <StatusType.CRASHED: 3>, <StatusType.MEMORYOUT: 5>, <StatusType.DONOTADVANCE: 6>], lower_budget_states=[], scale_percentage=5, seed=None)[source]¶
- class smac.runhistory.encoder.RunHistoryScaledEncoder(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:
RunHistoryEncoder
- class smac.runhistory.encoder.RunHistorySqrtScaledEncoder(*args, **kwargs)[source]¶
Bases:
RunHistoryEncoder