smac.epm.multi_objective_epm¶
Classes
|
Wrapper for the surrogate models to predict multiple targets. |
- class smac.epm.multi_objective_epm.MultiObjectiveEPM(target_names, configspace, types, bounds, seed, instance_features=None, pca_components=None, model_kwargs=None)[source]¶
Bases:
smac.epm.base_epm.BaseEPM
Wrapper for the surrogate models to predict multiple targets.
Only a list with the target names and the types array for the underlying model are mandatory. All other hyperparameters to model can be passed via kwargs. Consult the documentation of the corresponding model for the hyperparameters and their meanings.
- Parameters
target_names (list) – List of str, each entry is the name of one target dimension. Length of the list will be
n_objectives
.types (List[int]) – Specifies the number of categorical values of an input dimension where the i-th entry corresponds to the i-th input dimension. Let’s say we have 2 dimension where the first dimension consists of 3 different categorical choices and the second dimension is continuous than we have to pass [3, 0]. Note that we count starting from 0.
bounds (List[Tuple[float, float]]) – bounds of input dimensions: (lower, uppper) for continuous dims; (n_cat, np.nan) for categorical dims
instance_features (np.ndarray (I, K)) – Contains the K dimensional instance features of I different instances
pca_components (float) – Number of components to keep when using PCA to reduce dimensionality of instance features. Requires to set n_feats (> pca_dims).
model_kwargs (Optional[Dict[str, Any]]:) – arguments for initialing estimators
- target_names¶
target names
- num_targets¶
number of targets
- Type
int
- abstract construct_estimators(configspace, types, bounds, model_kwargs)[source]¶
Construct a list of estimators. The number of the estimators equals ‘self.num_targets’ :type configspace:
ConfigurationSpace
:param configspace: Configuration space to tune for. :type configspace: ConfigurationSpace :type types:List
[int
] :param types: Specifies the number of categorical values of an input dimension wherethe i-th entry corresponds to the i-th input dimension. Let’s say we have 2 dimension where the first dimension consists of 3 different categorical choices and the second dimension is continuous than we have to pass [3, 0]. Note that we count starting from 0.
- Parameters
bounds (List[Tuple[float, float]]) – bounds of input dimensions: (lower, uppper) for continuous dims; (n_cat, np.nan) for categorical dims
model_kwargs (Dict[str, Any]) – model kwargs for initializing models
- Returns
estimators – A list of estimators
- Return type
List[BaseEPM]
- predict_marginalized_over_instances(X)[source]¶
Predict mean and variance marginalized over all instances.
Returns the predictive mean and variance marginalised over all instances for a set of configurations.
- Parameters
X (np.ndarray of shape = [n_features (config), ]) –
- Return type
Tuple
[ndarray
,ndarray
]- Returns
means (np.ndarray of shape = [n_samples, n_objectives]) – Predictive mean
vars (np.ndarray of shape = [n_samples, n_objectives]) – Predictive variance