How to save the model?
Can I use this model to estimate the output value for new inputs? For example, I want to predict output value for an input like this “[4.5, 4.2, 1.1, 2.6]”
Indeed, there is not method that gives you the metamodel coming from the Kriging model.
The KrigingPOD uses the Kriging class of openTURNS and you can get the KrigingResult object. And then from it, it is simple to get the metamodel to predict values for some specific inputs.
However, we have added an initial transformation (only accessible through a private attribute) so the metamodel is not defined into the original space. To do a prediction, you should run this command :
I can save the KrigingResults but I could not save the POD,
Because when predicting output for the new input, it also needs the POD to transform input data according to KrigingPOD (POD._transformation())
Ah yes, indeed the POD is not an OpenTURNS object and thus cannot be saved via the Study mechanism. However, if what you need in practice is the KrigingResult and the _transformation, you could save them separately, because both are OpenTURNS objects (the _transformation is simply an OpenTURNS Function). Something like this:
study.add('kriging_result', POD.getKrigingResult())
study.add('transformation', POD._transformation)
# ...
### Load study from save file ###
# ...
kriging_result = ot.KrigingResult()
transformation = ot.Function()
study.fillObject('kriging_result', kriging_result)
study.fillObject('transformation', transformation)