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

Renamed examples files to not contain 'test'

parent 9d047c1d
No related branches found
No related tags found
2 merge requests!29Preparation for release 1.1.0: fixes and test for pages,!28Merge to circumvent issues
Pipeline #45514 failed
File added
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import time import time
def convergence_test(engine, steps, error, train_samples, test_samples, def convergence(engine, steps, error, train_samples, test_samples,
test_data, plot = True, write = True): test_data, plot = True, write = True):
""" """
Tests the convergence for a metamodel over the number of given training Tests the convergence for a metamodel over the number of given training
......
...@@ -17,7 +17,7 @@ from bayesvalidrox.surrogate_models.engine import Engine ...@@ -17,7 +17,7 @@ from bayesvalidrox.surrogate_models.engine import Engine
from bayesvalidrox.surrogate_models.exp_designs import ExpDesigns from bayesvalidrox.surrogate_models.exp_designs import ExpDesigns
import bayesvalidrox.surrogate_models.surrogate_models as sm import bayesvalidrox.surrogate_models.surrogate_models as sm
from convergence_test import convergence_test from convergence import convergence
from testfunction import testfunction from testfunction import testfunction
def error(mean, std, true): def error(mean, std, true):
...@@ -125,12 +125,12 @@ if __name__=="__main__": ...@@ -125,12 +125,12 @@ if __name__=="__main__":
engine = Engine(MetaMod, Model, ExpDesign) engine = Engine(MetaMod, Model, ExpDesign)
# Run the convergence test # Run the convergence test
results_FastArd = convergence_test(engine, steps, error, train_samples, test_samples, test_data) results_FastArd = convergence(engine, steps, error, train_samples, test_samples, test_data)
# Change the loss function base-type # Change the loss function base-type
new_type = 'ols' new_type = 'ols'
engine.MetaModel.pce_reg_method = new_type engine.MetaModel.pce_reg_method = new_type
results_OLS = convergence_test(engine, steps, error, train_samples, test_samples, test_data) results_OLS = convergence(engine, steps, error, train_samples, test_samples, test_data)
# Do OLS with Constraints # Do OLS with Constraints
# The actual constraints can currently be found and changed in # The actual constraints can currently be found and changed in
...@@ -138,7 +138,7 @@ if __name__=="__main__": ...@@ -138,7 +138,7 @@ if __name__=="__main__":
# will be improved in future releases # will be improved in future releases
engine.MetaModel.apply_constraints = True engine.MetaModel.apply_constraints = True
engine.MetaModel.init_type = 'zeros' engine.MetaModel.init_type = 'zeros'
results_PI_0rand = convergence_test(engine, steps, error, train_samples, test_samples, test_data) results_PI_0rand = convergence(engine, steps, error, train_samples, test_samples, test_data)
# Plot the results # Plot the results
for key in results_FastArd[1]: for key in results_FastArd[1]:
......
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