13.7.9. Macro “modelerbuildSimpleGP.py”
13.7.9.1. Objective
This macro is the one described in Example: construction of a simple Kriging model, that creates a
simple gaussian process, whose training (utf_4D_train.dat) and testing (utf_4D_test.dat) database
can both be found in the document folder of the Uranie installation
(${URANIESYS}/share/uranie/docUMENTS).
13.7.9.2. Macro Uranie
"""
Example of Gaussian Process building
"""
from URANIE import DataServer, Modeler
# Load observations
tdsObs = DataServer.TDataServer("tdsObs", "observations")
tdsObs.fileDataRead("utf_4D_train.dat")
# Construct the GPBuilder
gpb = Modeler.TGPBuilder(tdsObs, # observations data
"x1:x2:x3:x4", # list of input variables
"y", # output variable
"matern3/2") # name of the correlation function
# Search for the optimal hyper-parameters
gpb.findOptimalParameters("ML", # optimisation criterion
100, # screening design size
"neldermead", # optimisation algorithm
500) # max. number of optim iterations
# Construct the kriging model
krig = gpb.buildGP()
# Display model information
krig.printLog()
13.7.9.3. Console
This is the result of the last command:
.*******************************
** TKriging::printLog[]
*******************************
Input Variables: x1:x2:x3:x4
Output Variable: y
Deterministic trend:
Correlation function: URANIE::Modeler::TMatern32CorrFunction
Correlation length: normalised (not normalised)
1.6181e+00 (1.6172e+00 )
1.4372e+00 (1.4370e+00 )
1.5026e+00 (1.5009e+00 )
6.7884e+00 (6.7944e+00 )
Variance of the gaussian process: 70.8755
RMSE (by Leave One Out): 0.499108
Q2: 0.849843
*******************************