smac.epm.uncorrelated_mo_rf_with_instances module

class smac.epm.uncorrelated_mo_rf_with_instances.UncorrelatedMultiObjectiveRandomForestWithInstances(target_names: List[str], configspace: ConfigSpace.configuration_space.ConfigurationSpace, types: List[int], bounds: List[Tuple[float, float]], seed: int, rf_kwargs: Optional[Dict[str, Any]] = None, instance_features: Optional[numpy.ndarray] = None, pca_components: Optional[int] = None)

Bases: smac.epm.base_epm.AbstractEPM

Wrapper for the random forest to predict multiple targets.

Only the a list with the target names and the types array for the underlying forest model are mandatory. All other hyperparameters to the random forest can be passed via kwargs. Consult the documentation of the random forest for the hyperparameters and their meanings.

target_names
num_targets
estimators
_predict(X: numpy.ndarray, cov_return_type: Optional[str] = 'diagonal_cov') Tuple[numpy.ndarray, numpy.ndarray]

Predict means and variances for given X.

Parameters
  • X (np.ndarray of shape = [n_samples, n_features (config + instance) –

  • features)]

  • cov_return_type (typing.Optional[str]) – Specifies what to return along with the mean. Refer predict() for more information.

Returns

  • means (np.ndarray of shape = [n_samples, n_objectives]) – Predictive mean

  • vars (np.ndarray of shape = [n_samples, n_objectives]) – Predictive variance

_train(X: numpy.ndarray, Y: numpy.ndarray) smac.epm.uncorrelated_mo_rf_with_instances.UncorrelatedMultiObjectiveRandomForestWithInstances

Trains the random forest on X and y.

Parameters
  • X (np.ndarray [n_samples, n_features (config + instance features)]) – Input data points.

  • Y (np.ndarray [n_samples, n_objectives]) – The corresponding target values. n_objectives must match the number of target names specified in the constructor.

Returns

Return type

self

predict_marginalized_over_instances(X: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]

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), ]) –

Returns

  • means (np.ndarray of shape = [n_samples, n_objectives]) – Predictive mean

  • vars (np.ndarray of shape = [n_samples, n_objectives]) – Predictive variance