Extracting error estimates in UQpyLab

I’m working on a project with Polynomial Chaos Expansion (PCE) using UQLab in Python. I’ve built my PCE model, but I’m stuck on how to get the error estimates from the analysis.

In the MATLAB version of UQLab, I understand that the error estimates can be accessed through the myPCE.Error field, which includes:

  • Leave-One-Out (LOO) error (.LOO)
  • Modified Leave-One-Out error (.ModifiedLOO)
  • Normalized Empirical Error (.normEmpError)
  • Validation error (.Val), if a validation set is provided

How can I do this in Python?

Hi @Eilidh_Radcliff,

It is almost the same for UQ[py]Lab. The equivalent of a MATLAB structure is a Python dictionary. So the result myPCE = uq.createModel(MetaOpts) gives you a dictionary with all the information you are looking for. For example, you can get a dictionary with all errors as follows: myPCE["Error"]. The leave-one-out error, for example, will be returned as follows: myPCE["Error"]["LOO"].

I hope this solves your problem.

Best regards,
Styfen