From 06e86b923e69f7ddc891051dc0ba796484f94937 Mon Sep 17 00:00:00 2001
From: Farid Mohammadi <farid.mohammadi@iws.uni-stuttgart.de>
Date: Mon, 20 Jun 2022 16:54:37 +0200
Subject: [PATCH] [examples][pollution] add the bootstrapping arguments.

---
 examples/pollution/test_pollution.py       |  5 +++++
 examples/pollution/test_valid_pollution.py | 13 +++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/examples/pollution/test_pollution.py b/examples/pollution/test_pollution.py
index 3abd18dcb..9e9d56525 100644
--- a/examples/pollution/test_pollution.py
+++ b/examples/pollution/test_pollution.py
@@ -118,6 +118,11 @@ if __name__ == "__main__":
     # 7)EBL: Emperical Bayesian Learning
     MetaModelOpts.pce_reg_method = 'FastARD'
 
+    # Bootstraping
+    # 1) normal 2) fast
+    MetaModelOpts.bootstrap_method = 'fast'
+    MetaModelOpts.n_bootstrap_itrs = 100
+
     # Specify the max degree to be compared by the adaptive algorithm:
     # The degree with the lowest Leave-One-Out cross-validation (LOO)
     # error (or the highest score=1-LOO)estimator is chosen as the final
diff --git a/examples/pollution/test_valid_pollution.py b/examples/pollution/test_valid_pollution.py
index 1deea2f29..0d2a32c00 100644
--- a/examples/pollution/test_valid_pollution.py
+++ b/examples/pollution/test_valid_pollution.py
@@ -97,9 +97,9 @@ if __name__ == "__main__":
     MetaModelOpts = MetaModel(Inputs)
 
     # Select if you want to preserve the spatial/temporal depencencies
-    # MetaModelOpts.dim_red_method = 'PCA'
+    MetaModelOpts.dim_red_method = 'PCA'
     # MetaModelOpts.var_pca_threshold = 99.999
-    # MetaModelOpts.n_pca_components = 12
+    # MetaModelOpts.n_pca_components = 5
 
     # Select your metamodel method
     # 1) PCE (Polynomial Chaos Expansion) 2) aPCE (arbitrary PCE)
@@ -118,6 +118,11 @@ if __name__ == "__main__":
     # 7)EBL: Emperical Bayesian Learning
     MetaModelOpts.pce_reg_method = 'FastARD'
 
+    # Bootstraping
+    # 1) normal 2) fast
+    MetaModelOpts.bootstrap_method = 'fast'
+    MetaModelOpts.n_bootstrap_itrs = 100
+
     # Specify the max degree to be compared by the adaptive algorithm:
     # The degree with the lowest Leave-One-Out cross-validation (LOO)
     # error (or the highest score=1-LOO)estimator is chosen as the final
@@ -170,7 +175,7 @@ if __name__ == "__main__":
 
     # Plot the sobol indices
     if MetaModelOpts.meta_model_type != 'GPE':
-        sobol_cell, total_sobol = PostPCE.sobol_indices()
+        total_sobol = PostPCE.sobol_indices()
 
     # Compute and print RMSE error
     valid_samples = np.load("data/validSet.npy")
@@ -205,7 +210,7 @@ if __name__ == "__main__":
     DiscOutputOpts.add_marginals()
     DiscOutputOpts.Marginals[0].name = '$\\sigma^2_{\\epsilon}$'
     DiscOutputOpts.Marginals[0].dist_type = 'uniform'
-    DiscOutputOpts.Marginals[0].parameters = [0.0, 5.0]
+    DiscOutputOpts.Marginals[0].parameters = [0.0, 0.1]
     BayesOpts.Discrepancy = Discrepancy(DiscOutputOpts)
 
     # Start the inference
-- 
GitLab