smac.epm.random_epm module

class smac.epm.random_epm.RandomEPM(configspace: ConfigSpace.configuration_space.ConfigurationSpace, types: List[int], bounds: List[Tuple[float, float]], seed: int, instance_features: Optional[numpy.ndarray] = None, pca_components: Optional[int] = None)[source]

Bases: smac.epm.base_epm.AbstractEPM

EPM which returns random values on a call to fit.

Constructor

Parameters
  • configspace (ConfigurationSpace) – Configuration space to tune for.

  • types (List[int]) – 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.

  • bounds (List[Tuple[float, float]]) – bounds of input dimensions: (lower, uppper) for continuous dims; (n_cat, np.nan) for categorical dims

  • seed (int) – The seed that is passed to the model library.

  • instance_features (np.ndarray (I, K), optional) – Contains the K dimensional instance features of the I different instances

  • pca_components (float) – Number of components to keep when using PCA to reduce dimensionality of instance features. Requires to set n_feats (> pca_dims).

_predict(X: numpy.ndarray, cov_return_type: Optional[str] = 'diagonal_cov') → Tuple[numpy.ndarray, numpy.ndarray][source]

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.random_epm.RandomEPM[source]

Pseudo training on X and Y.

Parameters
  • X (np.ndarray (N, D)) – Input data points. The dimensionality of X is (N, D), with N as the number of points and D is the number of features.

  • Y (np.ndarray (N, 1)) – The corresponding target values.