smac.epm.rfr_imputator module

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

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

logging.Logger

max_iter

int

change_threshold

float

cutoff

float

threshold

float

seed

int – Created by drawing random int from rng

model

AbstractEPM – Predictive model (i.e. RandomForestWithInstances)

var_threshold

float

Constructor

Parameters:
  • rng (np.random.RandomState) – Will be used to draw a seed (currently not used)
  • cutoff (float) – Cutoff value for this scenario (upper runnning time limit)
  • threshold (float) – Highest possible values (e.g. cutoff * parX).
  • model (AbstractEPM) – Predictive model (i.e. RandomForestWithInstances)
  • change_threshold (float) – Stop imputation if change is less than this.
  • max_iter (int) – Maximum number of imputation iterations.
impute(censored_X: numpy.ndarray, censored_y: numpy.ndarray, uncensored_X: numpy.ndarray, uncensored_y: numpy.ndarray)[source]

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