Skip to content

gpr

Gaussian Process Regression (GPR) emulator implementation.

GPR

Bases: Emulator

Gaussian Process Regression (GPR) emulator class.

This class implements a GPR-based emulator that trains separate Gaussian Process models for each output variable. It supports various kernel types, feature transformations, and provides uncertainty quantification.

Parameters

data : pandas.DataFrame, optional Input and output features for training. input_names : list of str, optional Names of input features to use. If None, all columns in input_data are used. output_names : list of str, optional Names of output variables to emulate. If None, all columns in output_data are used. kernel : sklearn kernel object, optional Kernel to use for GP regression. If None, defaults to Matern kernel. transforms : list of dict, optional. Defaults to [{'type': 'standard_scaler'}] n_restarts_optimizer : int, optional Number of restarts for kernel hyperparameter optimization. Default is 10. return_std : bool, optional Whether to return prediction uncertainties. Default is True. verbose : bool, optional Enable verbose logging. Default is True.

__init__(data, input_names=None, output_names=None, kernel=None, transforms=[{'type': 'standard_scaler'}], n_restarts_optimizer=10, return_std=True, verbose=True)

Initialize the GPR emulator.

fit()

Fit the emulator to training data.

Parameters

self: GPR The GPR emulator instance containing the data and configuration.

Returns

self : GPR Fitted GPR emulator instance.

load(filename) classmethod

Load a fitted emulator from a file.

Parameters

filename : str Path to the saved emulator file.

Returns

Emulator The loaded emulator instance.

predict(X, return_std=False)

Make predictions using the fitted GPR emulators.

Parameters

X : pandas.DataFrame Input features for prediction return_std : bool, default False Whether to return prediction standard deviation

Returns

predictions : pandas.DataFrame Predicted values for each output std : pandas.DataFrame, optional Prediction standard deviations (if return_std=True)

prepare_pestpp(t_d, pst=None, verbose=False, **kwargs)

Prepare PEST++ interface for GPR. Wraps base implementation with support for legacy signature.

Legacy signature: prepare_pestpp(pst_dir, casename, gpr_t_d="gpr_template")

save(filename)

Save the fitted emulator to a file.

Parameters

filename : str Path to save the emulator.