13.7.10. Macro “modelerbuildGPInitPoint.py”
13.7.10.1. Objective
This macro is the one described in Choice of the initial point of the optimisation, that creates a
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), and whose starting point, in the parameter space, is
specified.
13.7.10.2. Macro Uranie
"""
Example of Gaussian Process building with initial point set
"""
import numpy as np
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, "x1:x2:x3:x4", "y", "matern3/2")
# Set the correlation function parameters
params = np.array([1.0, 0.25, 0.01, 0.3])
gpb.getCorrFunction().setParameters(params)
# Find the optimal parameters
gpb.findOptimalParameters("ML", # optimisation criterion
0, # screening size MUST be equal to 0
"neldermead", # optimisation algorithm
500, # max. number of optim iterations
False) # Don't reset parameters of GP builder
# Create the kriging model
krig = gpb.buildGP()
# Display model information
krig.printLog()
13.7.10.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.6182e+00 (1.6173e+00 )
1.4373e+00 (1.4371e+00 )
1.5027e+00 (1.5011e+00 )
6.7895e+00 (6.7955e+00 )
Variance of the gaussian process: 70.8914
RMSE (by Leave One Out): 0.49911
Q2: 0.849842
*******************************