From 01905378654df32265546472f07f0f6de8f71dcf Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Fri, 30 Jun 2023 03:33:23 +0800 Subject: [PATCH] hypothesis error. --- python-package/xgboost/testing/params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-package/xgboost/testing/params.py b/python-package/xgboost/testing/params.py index 8dc91b6017be..ac12c0bc5639 100644 --- a/python-package/xgboost/testing/params.py +++ b/python-package/xgboost/testing/params.py @@ -5,7 +5,7 @@ import pytest strategies = pytest.importorskip("hypothesis.strategies") - +max_leaves = [2**i + 1 for i in range(0, 10)] + [0] exact_parameter_strategy = strategies.fixed_dictionaries( { @@ -27,7 +27,7 @@ hist_parameter_strategy = strategies.fixed_dictionaries( { "max_depth": strategies.integers(1, 11), - "max_leaves": strategies.integers(0, 1024), + "max_leaves": strategies.sampled_from(max_leaves), "max_bin": strategies.integers(2, 512), "grow_policy": strategies.sampled_from(["lossguide", "depthwise"]), "min_child_weight": strategies.floats(0.5, 2.0), @@ -44,7 +44,7 @@ hist_multi_parameter_strategy = strategies.fixed_dictionaries( { "max_depth": strategies.integers(1, 11), - "max_leaves": strategies.integers(0, 1024), + "max_leaves": strategies.sampled_from(max_leaves), "max_bin": strategies.integers(2, 512), "multi_strategy": strategies.sampled_from( ["multi_output_tree", "one_output_per_tree"]