# Extracting error estimates in UQpyLab

**URL:** <https://uqworld.org/t/extracting-error-estimates-in-uqpylab/3763>\
**Category:** UQ Discussion Forum\
**Created:** [August 7, 2024, 11:43am UTC](https://uqworld.org/t/extracting-error-estimates-in-uqpylab/3763 "2024-08-07T11:43:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eilidh\_Radcliff](https://uqworld.org/user_avatar/uqworld.org/eilidh_radcliff/32/1221_2.png) [@Eilidh\_Radcliff](https://uqworld.org/u/Eilidh_Radcliff)\
**Post date:** [August 7, 2024, 11:43am UTC](https://uqworld.org/t/extracting-error-estimates-in-uqpylab/3763/1 "2024-08-07T11:43:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![styfen.schaer](https://uqworld.org/user_avatar/uqworld.org/styfen.schaer/32/849_2.png) [@styfen.schaer](https://uqworld.org/u/styfen.schaer)\
**Post date:** [August 7, 2024, 3:16pm UTC](https://uqworld.org/t/extracting-error-estimates-in-uqpylab/3763/2 "2024-08-07T15:16:56Z")

</div>

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
