Skip to content

Commit

Permalink
Relax linear test. (#5849)
Browse files Browse the repository at this point in the history
* Increased error in coordinate is mostly due to floating point error.
* Shotgun uses Hogwild!, which is non-deterministic and can have even greater
floating point error.
  • Loading branch information
trivialfis committed Jul 2, 2020
1 parent eb067c1 commit 4d277d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/python/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_coordinate(self, param, num_rounds, dataset, coord_param):
param.update(coord_param)
param = dataset.set_params(param)
result = train_result(param, dataset.get_dmat(), num_rounds)['train'][dataset.metric]
assert tm.non_increasing(result)
assert tm.non_increasing(result, 5e-4)

# Loss is not guaranteed to always decrease because of regularisation parameters
# We test a weaker condition that the loss has not increased between the first and last
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_shotgun(self, param, num_rounds, dataset):
sampled_result[-1] = result[-1] # make sure the last one is used
else:
sampled_result = result
assert tm.non_increasing(sampled_result)
assert tm.non_increasing(sampled_result, 1e-3)

@given(parameter_strategy, strategies.integers(10, 50),
tm.dataset_strategy, strategies.floats(1e-5, 2.0),
Expand Down

0 comments on commit 4d277d7

Please sign in to comment.