smac.epm.uncorrelated_mo_rf_with_instances module

class smac.epm.uncorrelated_mo_rf_with_instances.UncorrelatedMultiObjectiveRandomForestWithInstances(target_names: typing.List[str], bounds: numpy.ndarray, types: numpy.ndarray, rf_kwargs: typing.Union[typing.Dict[str, typing.Any], NoneType] = None, **kwargs)[source]

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

Constructor

Parameters:
predict(X: numpy.ndarray)

Predict means and variances for given X.

Parameters:X (np.ndarray of shape = [n_samples, n_features (config + instance features)]) – Training samples
Returns:
  • means (np.ndarray of shape = [n_samples, n_objectives]) – Predictive mean
  • vars (np.ndarray of shape = [n_samples, n_objectives]) – Predictive variance
predict_marginalized_over_instances(X: numpy.ndarray)[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), ]) –
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, **kwargs)

Trains the EPM 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:

self

Return type:

AbstractEPM