[backport] Fix GPU L1 error. (#8749) (#8770)

* [backport] Fix GPU L1 error. (#8749)

* Fix backport.
This commit is contained in:
Jiaming Yuan
2023-02-09 20:16:39 +08:00
committed by GitHub
parent df984f9c43
commit 60303db2ee
5 changed files with 74 additions and 13 deletions

View File

@@ -458,6 +458,22 @@ class TestTreeMethod:
config_0 = json.loads(booster_0.save_config())
np.testing.assert_allclose(get_score(config_0), get_score(config_1) + 1)
evals_result: Dict[str, Dict[str, list]] = {}
xgb.train(
{
"tree_method": tree_method,
"objective": "reg:absoluteerror",
"subsample": 0.8
},
Xy,
num_boost_round=10,
evals=[(Xy, "Train")],
evals_result=evals_result,
)
mae = evals_result["Train"]["mae"]
assert mae[-1] < 20.0
assert tm.non_increasing(mae)
@pytest.mark.skipif(**tm.no_sklearn())
@pytest.mark.parametrize(
"tree_method,weighted", [