Skip to content
Snippets Groups Projects
Commit b477a5df authored by kohlhaasrebecca's avatar kohlhaasrebecca
Browse files

[fix] Add output-option to check_reg_quality

Also added related PCE-tests
parent deccca7f
No related branches found
No related tags found
1 merge request!37Fix/post processing
...@@ -846,13 +846,10 @@ class PostProcessing: ...@@ -846,13 +846,10 @@ class PostProcessing:
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
def check_reg_quality(self, n_samples:int=1000, samples=None, outputs:dict=None)->None: def check_reg_quality(self, n_samples:int=1000, samples=None, outputs:dict=None)->None:
"""
"""
""" """
Checks the quality of the metamodel for single output models based on: Checks the quality of the metamodel for single output models based on:
https://towardsdatascience.com/how-do-you-check-the-quality-of-your-regression-model-in-python-fa61759ff685 https://towardsdatascience.com/how-do-you-check-the-quality-of-your-regression-model-in-python-fa61759ff685
Parameters Parameters
---------- ----------
n_samples : int, optional n_samples : int, optional
...@@ -863,6 +860,10 @@ class PostProcessing: ...@@ -863,6 +860,10 @@ class PostProcessing:
Output dictionary with model outputs for all given output types in Output dictionary with model outputs for all given output types in
`Model.Output.names`. The default is None. `Model.Output.names`. The default is None.
Return
------
None
""" """
if samples is None: if samples is None:
self.n_samples = n_samples self.n_samples = n_samples
...@@ -871,7 +872,10 @@ class PostProcessing: ...@@ -871,7 +872,10 @@ class PostProcessing:
self.n_samples = samples.shape[0] self.n_samples = samples.shape[0]
# Evaluate the original and the surrogate model # Evaluate the original and the surrogate model
y_val = self._eval_model(samples, key_str='valid') if outputs is None:
y_val = self._eval_model(samples, key_str='valid')
else:
y_val = outputs
y_pce_val, _ = self.engine.eval_metamodel(samples=samples) y_pce_val, _ = self.engine.eval_metamodel(samples=samples)
# Open a pdf for the plots # Open a pdf for the plots
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment