cosapp.utils.surrogate_models.kriging

Surrogate model based on Kriging.

Classes

FloatKrigingSurrogate([nugget, eval_rmse])

Surrogate model based on the simple Kriging interpolation.

KrigingSurrogate([nugget, eval_rmse])

Surrogate Modeling method based on the simple Kriging interpolation.

class cosapp.utils.surrogate_models.kriging.FloatKrigingSurrogate(nugget=np.float64(2.220446049250313e-15), eval_rmse=False)[source]

Bases: KrigingSurrogate

Surrogate model based on the simple Kriging interpolation.

Predictions are returned as floats, which are the mean of the model’s prediction.

predict(x)[source]

Calculate predicted value of response based on the current trained model.

Parameters:

x (array-like) – Point at which the surrogate is evaluated.

Returns:

Mean value of kriging prediction.

Return type:

float

class cosapp.utils.surrogate_models.kriging.KrigingSurrogate(nugget=np.float64(2.220446049250313e-15), eval_rmse=False)[source]

Bases: SurrogateModel

Surrogate Modeling method based on the simple Kriging interpolation.

Predictions are returned as a tuple of mean and RMSE. Based on Gaussian Processes for Machine Learning (GPML) by Rasmussen and Williams. (see also: scikit-learn).

alpha

Reduced likelihood parameter: alpha

Type:

ndarray

eval_rmse

When true, calculate the root mean square prediction error.

Type:

bool

L

Reduced likelihood parameter: L

Type:

ndarray

n_dims

Number of independents in the surrogate

Type:

int

n_samples

Number of training points.

Type:

int

nugget

Nugget smoothing parameter for smoothing noisy data. Represents the variance of the input values. If nugget is an ndarray, it must be of the same length as the number of training points. Default: 10. * Machine Epsilon

Type:

double or ndarray, optional

sigma2

Reduced likelihood parameter: sigma squared

Type:

ndarray

thetas

Kriging hyperparameters.

Type:

ndarray

X

Training input values, normalized.

Type:

ndarray

X_mean

Mean of training input values, normalized.

Type:

ndarray

X_std

Standard deviation of training input values, normalized.

Type:

ndarray

Y

Training model response values, normalized.

Type:

ndarray

Y_mean

Mean of training model response values, normalized.

Type:

ndarray

Y_std

Standard deviation of training model response values, normalized.

Type:

ndarray

linearize(x)[source]

Calculate the jacobian of the Kriging surface at the requested point.

Parameters:

x (array-like) – Point at which the surrogate Jacobian is evaluated.

Returns:

Jacobian of surrogate output wrt inputs.

Return type:

ndarray

predict(x)[source]

Calculate predicted value of the response based on the current trained model.

Parameters:

x (array-like) – Point at which the surrogate is evaluated.

Returns:

  • ndarray – Kriging prediction.

  • ndarray, optional (if eval_rmse is True) – Root mean square of the prediction error.

train(x, y)[source]

Train the surrogate model with the given set of inputs and outputs.

Parameters:
  • x (array-like) – Training input locations

  • y (array-like) – Model responses at given inputs.