From a1d23f6613200b35d178e02202c3dbb104fa7bc6 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Fri, 30 Apr 2021 09:04:11 +0800 Subject: [PATCH] Relax test for decision stump in distributed environment. (#6919) --- tests/python/test_with_dask.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/python/test_with_dask.py b/tests/python/test_with_dask.py index f8403cdf07f3..eae0f54b104d 100644 --- a/tests/python/test_with_dask.py +++ b/tests/python/test_with_dask.py @@ -1023,7 +1023,17 @@ def run_updater_test( evals=[(m, 'train')])['history'] note(history) history = history['train'][dataset.metric] - assert tm.non_increasing(history) + + def is_stump(): + return params["max_depth"] == 1 or params["max_leaves"] == 1 + + def minimum_bin(): + return "max_bin" in params and params["max_bin"] == 2 + + if minimum_bin() and is_stump(): + assert tm.non_increasing(history, tolerance=1e-3) + else: + assert tm.non_increasing(history) # Make sure that it's decreasing assert history[-1] < history[0]