kriging.py#
Surrogate model based on Kriging.
- class openmdao.surrogate_models.kriging.KrigingSurrogate(**kwargs)[source]
Bases:
SurrogateModelSurrogate 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).
- Parameters:
- **kwargsdict
Options dictionary.
- Attributes:
- alphandarray
Reduced likelihood parameter: alpha
- Lndarray
Reduced likelihood parameter: L
- n_dimsint
Number of independents in the surrogate
- n_samplesint
Number of training points.
- sigma2ndarray
Reduced likelihood parameter: sigma squared
- thetasndarray
Kriging hyperparameters.
- Xndarray
Training input values, normalized.
- X_meanndarray
Mean of training input values, normalized.
- X_stdndarray
Standard deviation of training input values, normalized.
- Yndarray
Training model response values, normalized.
- Y_meanndarray
Mean of training model response values, normalized.
- Y_stdndarray
Standard deviation of training model response values, normalized.
- _minimizefunction
Lazily imported scipy.optimize.minimize function.
- __init__(**kwargs)[source]
Initialize all attributes.
- Parameters:
- **kwargsdict
options dictionary.
- linearize(x)[source]
Calculate the jacobian of the Kriging surface at the requested point.
- Parameters:
- xarray-like
Point at which the surrogate Jacobian is evaluated.
- Returns:
- ndarray
Jacobian of surrogate output wrt inputs.
- predict(x)[source]
Calculate predicted value of the response based on the current trained model.
- Parameters:
- xarray-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, verbose=False, method='SLSQP', **minimize_options)[source]
Train the surrogate model with the given set of inputs and outputs.
Additional options for the internal hyperparameter training with scipy.optimize.minimize can be passed as keyword arguments.
The default options passed are {‘tol’: 1e-3, ‘maxiter’: 50}.
- Parameters:
- xarray-like
Training input locations.
- yarray-like
Model responses at given inputs.
- verbosebool, optional
Print internal minimization results and post-training data for debugging.
- methodstr, optional
Optimization method to use for hyperparameter tuning. Default is ‘L-BFGS-B’, which is the standard for Kriging/Gaussian processes. Other options include ‘SLSQP’, ‘TNC’, etc.
- **minimize_optionsdict
Additional options passed to scipy.optimize.minimize.
- vectorized_predict(x)
Calculate predicted values of the response based on the current trained model.
- Parameters:
- xarray-like
Vectorized point(s) at which the surrogate is evaluated.