smac.epm.random_forest.rf_mo

Classes

MultiObjectiveRandomForest(target_names, ...)

Wrapper for the random forest to predict multiple targets.

class smac.epm.random_forest.rf_mo.MultiObjectiveRandomForest(target_names, configspace, types, bounds, seed, instance_features=None, pca_components=None, model_kwargs=None)[source]

Bases: smac.epm.multi_objective_epm.MultiObjectiveEPM

Wrapper for the random forest to predict multiple targets.

Only 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.

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 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.

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 Random Forests

Return type

List[BaseEPM]