Skip to content

Commit c97ad1d

Browse files
committed
Merge pull request scikit-learn#4592 from clorenz7/bugfix/gauss_proc_eps_issue
[MRG+1] Fix Float Resolution Bug on Gaussian Process Test
2 parents c5358ca + 5ad1dfe commit c97ad1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/gaussian_process/tests/test_gaussian_process.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ def test_2d(regr=regression.constant, corr=correlation.squared_exponential,
6666

6767
assert_true(np.allclose(y_pred, y) and np.allclose(MSE, 0.))
6868

69-
assert_true(np.all(gp.theta_ >= thetaL)) # Lower bounds of hyperparameters
70-
assert_true(np.all(gp.theta_ <= thetaU)) # Upper bounds of hyperparameters
69+
eps = np.finfo(gp.theta_.dtype).eps
70+
assert_true(np.all(gp.theta_ >= thetaL - eps)) # Lower bounds of hyperparameters
71+
assert_true(np.all(gp.theta_ <= thetaU + eps)) # Upper bounds of hyperparameters
7172

7273

7374
def test_2d_2d(regr=regression.constant, corr=correlation.squared_exponential,

0 commit comments

Comments
 (0)