Gaussian process
smac.model.gaussian_process.gaussian_process
#
GaussianProcess
#
GaussianProcess(
configspace: ConfigurationSpace,
kernel: Kernel,
n_restarts: int = 10,
normalize_y: bool = True,
instance_features: (
dict[str, list[int | float]] | None
) = None,
pca_components: int | None = 7,
seed: int = 0,
)
Bases: AbstractGaussianProcess
Implementation of Gaussian process model. The Gaussian process hyperparameters 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
| PARAMETER | DESCRIPTION |
|---|---|
configspace
|
TYPE:
|
kernel
|
Kernel which is used for the Gaussian process.
TYPE:
|
n_restarts
|
Number of restarts for the Gaussian process hyperparameter optimization.
TYPE:
|
normalize_y
|
Zero mean unit variance normalization of the output values.
TYPE:
|
instance_features
|
Features (list of int or floats) of the instances (str). The features are incorporated into the X data, on which the model is trained on.
TYPE:
|
pca_components
|
Number of components to keep when using PCA to reduce dimensionality of instance features.
TYPE:
|
seed
|
TYPE:
|
Source code in smac/model/gaussian_process/gaussian_process.py
predict
#
Predicts mean and variance for a given X. Internally, calls the method _predict.
| PARAMETER | DESCRIPTION |
|---|---|
X
|
Input data points.
TYPE:
|
covariance_type
|
Specifies what to return along with the mean. Applied only to Gaussian Processes. Takes four valid inputs: * None: Only the mean is returned. * "std": Standard deviation at test points is returned. * "diagonal": Diagonal of the covariance matrix is returned. * "full": Whole covariance matrix between the test points is returned.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
means
|
The predictive mean.
TYPE:
|
vars
|
Predictive variance or standard deviation.
TYPE:
|
Source code in smac/model/abstract_model.py
predict_marginalized
#
Predicts mean and variance marginalized over all instances.
Warning
The input data must not include any features.
| PARAMETER | DESCRIPTION |
|---|---|
X
|
Input data points.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
means
|
The predictive mean.
TYPE:
|
vars
|
The predictive variance.
TYPE:
|
Source code in smac/model/abstract_model.py
sample_functions
#
Samples F function values from the current posterior at the N specified test points.
| PARAMETER | DESCRIPTION |
|---|---|
X_test
|
Input data points.
TYPE:
|
n_funcs
|
Number of function values that are drawn at each test point.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
function_samples
|
The F function values drawn at the N test points.
TYPE:
|
Source code in smac/model/gaussian_process/gaussian_process.py
train
#
Trains the random forest on X and Y. Internally, calls the method _train.
| PARAMETER | DESCRIPTION |
|---|---|
X
|
Input data points.
TYPE:
|
Y
|
The corresponding target values.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
self
|
TYPE:
|