autoemulate.emulators.gaussian_process#

class GaussianProcessSklearn(kernel=RBF(length_scale=1), alpha=1e-10, optimizer='fmin_l_bfgs_b', n_restarts_optimizer=20, normalize_y=True, copy_X_train=True, random_state=None)[source]#

Bases: BaseEstimator, RegressorMixin

Gaussian Process Emulator.

Wraps GaussianProcessRegressor from scikit-learn.

fit(X, y)[source]#

Fits the emulator to the data.

Parameters:
  • X ({array-like, sparse matrix}, shape (n_samples, n_features)) – The training input samples.

  • y (array-like, shape (n_samples,) or (n_samples, n_outputs)) – The target values (real numbers).

Returns:

self – Returns self.

Return type:

object

predict(X, return_std=False)[source]#

Predicts the output of the simulator for a given input.

Parameters:
  • X ({array-like, sparse matrix}, shape (n_samples, n_features)) – The training input samples.

  • return_std (bool) – If True, returns a touple with two ndarrays, one with the mean and one with the standard deviations of the prediction.

Returns:

y – Model predictions.

Return type:

ndarray, shape (n_samples,)

get_grid_params(search_type='random')[source]#

Returns the grid parameters of the emulator.

set_predict_request(*, return_std='$UNCHANGED$')#

Request metadata passed to the predict method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to predict.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:

return_std (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for return_std parameter in predict.

Returns:

self – The updated object.

Return type:

object