Mcmc gaussian process
smac.model.gaussian_process.mcmc_gaussian_process
#
MCMCGaussianProcess
#
MCMCGaussianProcess(
configspace: ConfigurationSpace,
kernel: Kernel,
n_mcmc_walkers: int = 20,
chain_length: int = 50,
burning_steps: int = 50,
mcmc_sampler: str = "emcee",
average_samples: bool = False,
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 a Gaussian process model which out-integrates its hyperparameters by Markow-Chain-Monte-Carlo (MCMC). If you use this class make sure that you also use an integrated acquisition function to integrate over the GP's hyperparameter as proposed by Snoek et al.
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_mcmc_walkers
|
The number of hyperparameter samples. This also determines the number of walker for MCMC sampling as each walker will return one hyperparameter sample.
TYPE:
|
chain_length
|
The length of the MCMC chain. We start
TYPE:
|
burning_steps
|
The number of burning steps before the actual MCMC sampling starts.
TYPE:
|
mcmc_sampler
|
Choose a self-tuning MCMC sampler. Can be either
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/mcmc_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
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:
|