smac.epm.rfr_imputator module

class smac.epm.rfr_imputator.RFRImputator(rng: numpy.random.mtrand.RandomState, cutoff: float, threshold: float, model: smac.epm.base_epm.AbstractEPM, change_threshold: float = 0.01, max_iter: int = 2)

Bases: smac.epm.base_imputor.BaseImputor

Imputor using pyrfr’s Random Forest regressor.

Note: Sets var_threshold as the lower bound on the variance for the predictions of the random forest

logger
Type

logging.Logger

max_iter
Type

int

change_threshold
Type

float

cutoff
Type

float

threshold
Type

float

seed

Created by drawing random int from rng

Type

int

model

Predictive model (i.e. RandomForestWithInstances)

Type

AbstractEPM

var_threshold
Type

float

impute(censored_X: numpy.ndarray, censored_y: numpy.ndarray, uncensored_X: numpy.ndarray, uncensored_y: numpy.ndarray) Optional[numpy.ndarray]

Imputes censored runs and returns new y values.

Parameters
  • censored_X (np.ndarray [N, M]) – Feature array of all censored runs.

  • censored_y (np.ndarray [N, 1]) – Target values for all runs censored runs.

  • uncensored_X (np.ndarray [N, M]) – Feature array of all non-censored runs.

  • uncensored_y (np.ndarray [N, 1]) – Target values for all non-censored runs.

Returns

imputed_y – Same shape as censored_y [N, 1]

Return type

np.ndarray