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.- Parameters:
- inputSample, outputSample
Sample
The samples and .
- metaModel
Function
The meta model: , defined in :eq:metaModelGPF.
- residuals
Point
The residual errors.
- relativeErrors
Point
The relative errors.
- regressionMatrix
Matrix
The regression matrix, e.g the evaluation of the basis function upon the input design sample.
- basis
Basis
Functional basis of size : for each . Its size should be equal to zero if the trend is not estimated.
- trendCoefsequence of float
The trend coefficients vectors stored as a Point.
- covarianceModel
CovarianceModel
Covariance function 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.
- inputSample, outputSample
Methods
getBasis
()Accessor to the basis.
Accessor to the object's name.
Accessor to the covariance model.
Accessor to the input sample.
Accessor to the used linear algebra method to fit.
Accessor to the metamodel.
getName
()Accessor to the object's name.
getNoise
()Accessor to the Gaussian process.
Accessor to the optimal log-likelihood of the model.
Accessor to the output sample.
Accessor to the regression matrix.
Accessor to the relative errors.
Accessor to the residuals.
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.
setRelativeErrors
(relativeErrors)Accessor to the relative errors.
setResiduals
(residuals)Accessor to the residuals.
Notes
The structure is usually created by the method run of a
GaussianProcessFitter
, and obtained thanks to the getResult() method.The meta model is defined by:
(1)¶
where and are the trend functions (the marginal of ).
(2)¶
Examples
Create the model 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 meta model:
>>> 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:
- basis
Basis
Functional basis of size : for each .
- basis
Notes
If the trend is not estimated, the basis is empty.
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getCovarianceModel()¶
Accessor to the covariance model.
- Returns:
- covModel
CovarianceModel
The covariance model of the Gaussian process W.
- covModel
- getLinearAlgebraMethod()¶
Accessor to the used linear algebra method 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.
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getNoise()¶
Accessor to the Gaussian process.
- Returns:
- process
Process
Returns the Gaussian process with the optimized parameters.
- process
- getOptimalLogLikelihood()¶
Accessor to the optimal log-likelihood of the model.
- Returns:
- optimalLogLikelihoodfloat
The value of the log-likelihood corresponding to the model.
- getRegressionMatrix()¶
Accessor to the regression matrix.
- Returns:
- process
Matrix
Returns the regression matrix.
- process
- getRelativeErrors()¶
Accessor to the relative errors.
- Returns:
- relativeErrors
Point
The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.
- relativeErrors
- getResiduals()¶
Accessor to the residuals.
- Returns:
- residuals
Point
The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.
- residuals
- getTrendCoefficients()¶
Accessor to the trend coefficients.
- Returns:
- trendCoefsequence of float
The trend coefficients vectors as a
Point
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setInputSample(sampleX)¶
Accessor to the input sample.
- Parameters:
- inputSample
Sample
The input sample.
- inputSample
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setOutputSample(sampleY)¶
Accessor to the output sample.
- Parameters:
- outputSample
Sample
The output sample.
- outputSample
- setRelativeErrors(relativeErrors)¶
Accessor to the relative errors.
- Parameters:
- relativeErrorssequence of float
The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.
- setResiduals(residuals)¶
Accessor to the residuals.
- Parameters:
- residualssequence of float
The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.
Examples using the class¶
Gaussian Process Regression : cantilever beam model
Gaussian Process Regression : quick-start