GaussianProcessFitterResult

class GaussianProcessFitterResult(*args)

Gaussian process fitter result.

Warning

This class is experimental and likely to be modified in future releases. To use it, import the openturns.experimental submodule.

Refer to Gaussian process regression.

Parameters:
inputSample, outputSampleSample

The samples (\vect{x}_k)_{1 \leq k \leq \sampleSize} \in \Rset^{\inputDim} and (\vect{y}_k)_{1 \leq k \leq \sampleSize}\in \Rset^{\outputDim}.

metaModelFunction

The metamodel: \metaModel, defined in (1) by the trend function.

regressionMatrixMatrix

The regression matrix, e.g the evaluation of the basis functions upon the input design sample.

basisBasis

Functional basis of size b : (\varphi_j: \Rset^{\inputDim} \rightarrow \Rset) for j \in [1, b]. Its size should be equal to zero if the trend is not estimated.

trendCoefsequence of float

The trend coefficients vectors (\vect{\beta}^1, \dots, \vect{\beta}^{\outputDim}).

covarianceModelCovarianceModel

The covariance model of the Gaussian process with its optimized parameters.

optimalLogLikelihoodfloat

The maximum log-likelihood corresponding to the model.

linAlgMethodint

The used linear algebra method to fit the model:

  • otexp.GaussianProcessFitterResult.LAPACK or 0: using LAPACK to fit the model,

  • otexp.GaussianProcessFitterResult.HMAT or 1: using HMAT to fit the model.

Methods

getBasis()

Accessor to the basis.

getClassName()

Accessor to the object's name.

getCovarianceModel()

Accessor to the covariance model.

getInputSample()

Accessor to the input sample.

getLinearAlgebraMethod()

Accessor to the linear algebra method used to fit.

getMetaModel()

Accessor to the metamodel.

getName()

Accessor to the object's name.

getNoise()

Accessor to the Gaussian process.

getOptimalLogLikelihood()

Accessor to the optimal log-likelihood of the model.

getOutputSample()

Accessor to the output sample.

getRegressionMatrix()

Accessor to the regression matrix.

getTrendCoefficients()

Accessor to the trend coefficients.

hasName()

Test if the object is named.

setInputSample(sampleX)

Accessor to the input sample.

setMetaModel(metaModel)

Accessor to the metamodel.

setName(name)

Accessor to the object's name.

setOutputSample(sampleY)

Accessor to the output sample.

getRelativeErrors

getResiduals

setRelativeErrors

setResiduals

Notes

The structure is usually created by the method run() of the class GaussianProcessFitter and obtained with its method getResult().

Refer to Gaussian process regression (Step 1) to get all the notations and the theoretical aspects. We only detail here the notions related to the class.

This class creates the metamodel \metaModel: \Rset^{\inputDim} \rightarrow \Rset^{\outputDim} defined by the estimated trend function:

(1)\metaModel(\vect{x}) = \vect{\mu}(\vect{x}) = \left(
  \begin{array}{l}
    \mu_1(\vect{x}) \\
    \vdots  \\
    \mu_\outputDim(\vect{x})
   \end{array}
 \right)

with \mu_\ell(\vect{x}) = \sum_{j=1}^{b} \beta_j^\ell \varphi_j(\vect{x}) and \varphi_j: \Rset^\inputDim \rightarrow \Rset the trend functions for 1 \leq j \leq b and 1 \leq \ell \leq \outputDim.

Examples

Create the model \model: \Rset \mapsto \Rset and the samples:

>>> import openturns as ot
>>> import openturns.experimental as otexp
>>> g = ot.SymbolicFunction(['x'],  ['x * sin(x)'])
>>> sampleX = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]]
>>> sampleY = g(sampleX)

Create the algorithm:

>>> basis = ot.Basis([ot.SymbolicFunction(['x'], ['x']), ot.SymbolicFunction(['x'], ['x^2'])])
>>> covarianceModel = ot.GeneralizedExponential([2.0], 2.0)
>>> algo = otexp.GaussianProcessFitter(sampleX, sampleY, covarianceModel, basis)
>>> algo.run()

Get the result:

>>> result = algo.getResult()

Get the metamodel \metaModel(\vect{x}) = \vect{\mu}(\vect{x}):

>>> metaModel = result.getMetaModel()
>>> graph = metaModel.draw(0.0, 7.0)
>>> cloud = ot.Cloud(sampleX, sampleY)
>>> cloud.setPointStyle('fcircle')
>>> graph = ot.Graph()
>>> graph.add(cloud)
>>> graph.add(g.draw(0.0, 7.0))
__init__(*args)
getBasis()

Accessor to the basis.

Returns:
basisBasis

Functional basis to estimate the trend: (\varphi_j)_{1 \leq j \leq b}: \Rset^\inputDim \rightarrow \Rset.

Notes

If the trend is not estimated, the basis is empty. The same basis is used for each marginal output.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getCovarianceModel()

Accessor to the covariance model.

Returns:
covModelCovarianceModel

The covariance model of the Gaussian process \vect{W} with its optimized parameters.

getInputSample()

Accessor to the input sample.

Returns:
inputSampleSample

The input sample.

getLinearAlgebraMethod()

Accessor to the linear algebra method used to fit.

Returns:
linAlgMethodint

The used linear algebra method to fit the model:

  • otexp.GaussianProcessFitterResult.LAPACK or 0: using LAPACK to fit the model,

  • otexp.GaussianProcessFitterResult.HMAT or 1: using HMAT to fit the model.

getMetaModel()

Accessor to the metamodel.

Returns:
metaModelFunction

Metamodel.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getNoise()

Accessor to the Gaussian process.

Returns:
processProcess

The Gaussian process \vect{W} its the optimized parameters.

getOptimalLogLikelihood()

Accessor to the optimal log-likelihood of the model.

Returns:
optimalLogLikelihoodfloat

The value of the log-likelihood corresponding to the model.

getOutputSample()

Accessor to the output sample.

Returns:
outputSampleSample

The output sample.

getRegressionMatrix()

Accessor to the regression matrix.

Returns:
processMatrix

Returns the regression matrix.

Notes

The regression matrix, e.g the evaluation of the basis functions upon the input design sample. It contains \sampleSize lines and as many column as the size of the functional basis. The column k is defined as:

\left(\varphi_k(\vect{x}_1), \dots,\varphi_k(\vect{x}_\sampleSize) \right).

getTrendCoefficients()

Accessor to the trend coefficients.

Returns:
trendCoefsequence of float

The trend coefficients vectors (\vect{\beta}^1, \dots, \vect{\beta}^{\outputDim}) as a Point.

Notes

As the same basis is used for each marginal output, each \vect{\beta}^\ell vector is of dimension b, the size of the functional basis.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setInputSample(sampleX)

Accessor to the input sample.

Parameters:
inputSampleSample

The input sample.

setMetaModel(metaModel)

Accessor to the metamodel.

Parameters:
metaModelFunction

Metamodel.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setOutputSample(sampleY)

Accessor to the output sample.

Parameters:
outputSampleSample

The output sample.

Examples using the class

Gaussian Process Regression vs KrigingAlgorithm

Gaussian Process Regression vs KrigingAlgorithm

Create a general linear model metamodel

Create a general linear model metamodel

Gaussian Process Regression: multiple input dimensions

Gaussian Process Regression: multiple input dimensions

Gaussian Process Regression : quick-start

Gaussian Process Regression : quick-start

Advanced Gaussian process regression

Advanced Gaussian process regression

Gaussian Process Regression: choose an arbitrary trend

Gaussian Process Regression: choose an arbitrary trend

Gaussian Process Regression: choose a polynomial trend on the beam model

Gaussian Process Regression: choose a polynomial trend on the beam model

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression: choose a polynomial trend

Gaussian Process Regression: choose a polynomial trend

Gaussian process fitter: configure the optimization solver

Gaussian process fitter: configure the optimization solver

Gaussian process regression: draw the likelihood

Gaussian process regression: draw the likelihood

Gaussian Process Regression : generate trajectories from the metamodel

Gaussian Process Regression : generate trajectories from the metamodel

Gaussian Process Regression: metamodel of the Branin-Hoo function

Gaussian Process Regression: metamodel of the Branin-Hoo function

Example of multi output Gaussian Process Regression on the fire satellite model

Example of multi output Gaussian Process Regression on the fire satellite model

Gaussian Process Regression: propagate uncertainties

Gaussian Process Regression: propagate uncertainties