How to load a PCE metamodel in python and test it?

Dear all,

I have created a PCE metamodel in Matlab and saved it, and I want to load this meta model in Python and feed it with a validation set there. any suggestions? How can I write a wrapper for uq_evalModel in python? (I don’t want to use UQ[py]lab)

In another word, I want to write a script in python that loads the PCE metalmodel created by UQlab in Matlab and tests it with a validation set.


Dear @Ahmadnr

Matlab allows you to call its functions from Python:

Is there any reason not to use UQ[py]Lab? I would still recommend doing so because it is probably the easiest and safest solution.

Best regards

1 Like

Dear @styfen.schaer ,

Thanks for your response,

In UQ[py]Lab since the calculations are carried out on the cloud it takes several seconds to validate your model with a validation set ( when I execute YPCE = uq.evalModel(my_PCE,x_validation) in python it takes 15 seconds, while the same code takes 0.1 second in MATLAB ).

So, I was wondering is there any way that I can evaluate my constructed model in UQ[py]Lab, i.e my_PCE, on a validation set (x_validation) out of my session in uqpylab? i.e. without running uq.evalModel command or generally without being in need of uqlab library?

Best regards,