Skip to content
Snippets Groups Projects
Commit e6458866 authored by Farid Mohammadi's avatar Farid Mohammadi
Browse files

[examples][pollution] uncomment save object via joblib.

parent e74e597f
No related branches found
No related tags found
1 merge request!1Resolve "Justifiability analysis"
......@@ -147,15 +147,15 @@ if __name__ == "__main__":
# >>>>>>>>>>>>>>>>>>>>>> Build Surrogate <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Adaptive sparse arbitrary polynomial chaos expansion
# PCEModel = MetaModelOpts.create_metamodel(Model)
PCEModel = MetaModelOpts.create_metamodel(Model)
# # Save PCE models
# with open(f"PCEModel_{Model.name}.pkl", "wb") as output:
# joblib.dump(PCEModel, output, 2)
# Save PCE models
with open(f"PCEModel_{Model.name}.pkl", "wb") as output:
joblib.dump(PCEModel, output, 2)
# Load the objects
with open(f"PCEModel_{Model.name}.pkl", "rb") as input:
PCEModel = joblib.load(input)
# with open(f"PCEModel_{Model.name}.pkl", "rb") as input:
# PCEModel = joblib.load(input)
# =====================================================
# ========= POST PROCESSING OF METAMODELS ===========
......@@ -209,15 +209,15 @@ if __name__ == "__main__":
BayesOpts.Discrepancy = Discrepancy(DiscOutputOpts)
# Start the inference
# BayesCalib = BayesOpts.create_inference()
BayesCalib = BayesOpts.create_inference()
# # Save class objects
# with open(f'Bayes_{Model.name}.pkl', 'wb') as output:
# joblib.dump(BayesCalib, output, 2)
# Save class objects
with open(f'Bayes_{Model.name}.pkl', 'wb') as output:
joblib.dump(BayesCalib, output, 2)
# Load the objects
with open(f"Bayes_{Model.name}.pkl", "rb") as input:
BayesCalib = joblib.load(input)
# with open(f"Bayes_{Model.name}.pkl", "rb") as input:
# BayesCalib = joblib.load(input)
# =====================================================
# =========== BAYESIAN MODEL VALIDATION ==============
......
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