smac.epm.gaussian_process.gp¶
Classes
|
Gaussian process model. |
- class smac.epm.gaussian_process.gp.GaussianProcess(configspace, types, bounds, seed, kernel, normalize_y=True, n_opt_restarts=10, instance_features=None, pca_components=None)[source]¶
Bases:
smac.epm.gaussian_process.BaseModel
Gaussian process model.
The GP hyperparameterŝ are obtained by optimizing the marginal log likelihood.
This code is based on the implementation of RoBO:
Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. RoBO: A Flexible and Robust Bayesian Optimization Framework in Python In: NIPS 2017 Bayesian Optimization Workshop
- Parameters
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) – Model seed.
kernel (george kernel object) – Specifies the kernel that is used for all Gaussian Process
prior (prior object) – Defines a prior for the hyperparameters of the GP. Make sure that it implements the Prior interface.
normalize_y (bool) – Zero mean unit variance normalization of the output values
n_opt_restart (int) – Number of restarts for GP hyperparameter optimization
instance_features (np.ndarray (I, K)) – 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).
- sample_functions(X_test, n_funcs=1)[source]¶
Samples F function values from the current posterior at the N specified test points.
- Parameters
X_test (np.ndarray (N, D)) – Input test points
n_funcs (int) – Number of function values that are drawn at each test point.
- Returns
function_samples – The F function values drawn at the N test points.
- Return type
np.array(N, F)