Skip to content

Commit

Permalink
fix seed
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Saves committed Jan 7, 2025
1 parent 2843dfc commit 93f4e80
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions smt/utils/test/test_misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ def prepare_tests_errors(self):
fun = Sphere(ndim=ndim)

sampling = LHS(xlimits=fun.xlimits, criterion="ese", random_state=42)
xt = sampling(40)
xt = sampling(20)
yt = fun(xt)
xe = sampling(120)
xe = sampling(100)
ye = fun(xe)
return xt, yt, xe, ye

def test_pva_error(self):
xt, yt, xe, ye = self.prepare_tests_errors()
sm = KRG(print_global=False, random_state=42)
sm = KRG(print_global=False, n_start=25, random_state=42)
sm.set_training_values(xt, yt)
sm.train()

pva = compute_pva(sm, xe, ye)
self.assertAlmostEqual(pva, 2.314, delta=1e-3)
self.assertAlmostEqual(pva, 0.1, delta=1e-2)

def test_rmse_error(self):
xt, yt, xe, ye = self.prepare_tests_errors()
Expand All @@ -63,7 +63,7 @@ def test_rmse_error(self):
sm.train()

rmse = compute_rmse(sm, xe, ye)
self.assertAlmostEqual(rmse, 0.0, delta=1e-3)
self.assertAlmostEqual(rmse, 0.0, delta=1e-2)

def test_q2_error(self):
xt, yt, xe, ye = self.prepare_tests_errors()
Expand All @@ -72,7 +72,7 @@ def test_q2_error(self):
sm.train()

q2 = compute_q2(sm, xe, ye)
self.assertAlmostEqual(q2, 1.0, delta=1e-3)
self.assertAlmostEqual(q2, 1.0, delta=1e-2)


if __name__ == "__main__":
Expand Down

0 comments on commit 93f4e80

Please sign in to comment.