From bc455fdac3e93af71189b1a24f86fbba853f3243 Mon Sep 17 00:00:00 2001
From: kohlhaasrebecca <rebecca.kohlhaas@outlook.com>
Date: Fri, 11 Oct 2024 15:11:57 +0200
Subject: [PATCH] Add 3d plot to analytical_example

---
 .../example_analytical_function.py                  | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/examples/analytical-function/example_analytical_function.py b/examples/analytical-function/example_analytical_function.py
index 1d0c90160..8d4a6a064 100644
--- a/examples/analytical-function/example_analytical_function.py
+++ b/examples/analytical-function/example_analytical_function.py
@@ -32,7 +32,7 @@ from bayesvalidrox import PyLinkForwardModel, Input, ExpDesigns, PCE, PostProces
 if __name__ == "__main__":
 
     # Number of parameters
-    ndim = 10  # 2, 10
+    ndim = 2  # 2, 10
 
     # =====================================================
     # =============   COMPUTATIONAL MODEL  ================
@@ -212,8 +212,8 @@ if __name__ == "__main__":
     
     # Run using the engine
     engine = Engine(MetaModelOpts, Model, ExpDesign)
-    engine.train_sequential()
-    #engine.train_normal()
+    #engine.train_sequential()
+    engine.train_normal()
 
     # Load the objects
     # with open(f"PCEModel_{Model.name}.pkl", "rb") as input:
@@ -231,9 +231,10 @@ if __name__ == "__main__":
     PostPCE.check_accuracy(n_samples=300)
 
     # Compute the moments and compare with the Monte-Carlo reference
-    # TODO: generalize the moment calculation
-    #if MetaModelOpts.meta_model_type != 'GPE':
     PostPCE.plot_moments()
+    
+    # Plot 3D output of the MetaModel
+    PostPCE.plot_metamodel_3d()
 
     # Plot the evolution of the KLD,BME, and Modified LOOCV error
     #if MetaModelOpts.ExpDesign.method == 'sequential':
@@ -241,8 +242,6 @@ if __name__ == "__main__":
     #    PostPCE.plot_seq_design_diagnostics(refBME_KLD)
 
     # Plot the sobol indices
-    # TODO: generalize this by using moment calculation(?)
-    #if MetaModelOpts.meta_model_type != 'GPE':
     total_sobol = PostPCE.sobol_indices()
 
     # =====================================================
-- 
GitLab