Abstract gaussian process
smac.model.gaussian_process.abstract_gaussian_process
#
AbstractGaussianProcess
#
AbstractGaussianProcess(
configspace: ConfigurationSpace,
kernel: Kernel,
instance_features: (
dict[str, list[int | float]] | None
) = None,
pca_components: int | None = 7,
seed: int = 0,
)
Bases: AbstractModel
Abstract base class for all Gaussian process models.
Parameters#
configspace : ConfigurationSpace kernel : Kernel Kernel which is used for the Gaussian process. instance_features : dict[str, list[int | float]] | None, defaults to None 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. pca_components : float, defaults to 7 Number of components to keep when using PCA to reduce dimensionality of instance features. seed : int
Source code in smac/model/gaussian_process/abstract_gaussian_process.py
predict
#
Predicts mean and variance for a given X. Internally, calls the method _predict
.
Parameters#
X : np.ndarray [#samples, #hyperparameters + #features] Input data points. covariance_type: str | None, defaults to "diagonal" 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.
Returns#
means : np.ndarray [#samples, #objectives] The predictive mean. vars : np.ndarray [#samples, #objectives] or [#samples, #samples] | None Predictive variance or standard deviation.
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.
Parameters#
X : np.ndarray [#samples, #hyperparameters] Input data points.
Returns#
means : np.ndarray [#samples, 1] The predictive mean. vars : np.ndarray [#samples, 1] The predictive variance.
Source code in smac/model/abstract_model.py
train
#
Trains the random forest on X and Y. Internally, calls the method _train
.
Parameters#
X : np.ndarray [#samples, #hyperparameters + #features] Input data points. Y : np.ndarray [#samples, #objectives] The corresponding target values.
Returns#
self : AbstractModel