Fix multi-output with alternating strategies. (#9933)

---------

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2024-01-04 16:41:13 +08:00
committed by GitHub
parent 5f7b5a6921
commit 621348abb3
6 changed files with 123 additions and 73 deletions

View File

@@ -8,6 +8,7 @@ import pytest
import xgboost as xgb
from xgboost import testing as tm
from xgboost.testing.updater import ResetStrategy
dpath = tm.data_dir(__file__)
@@ -653,11 +654,6 @@ class TestModels:
num_parallel_tree = 4
num_boost_round = 16
class ResetStrategy(xgb.callback.TrainingCallback):
def after_iteration(self, model, epoch: int, evals_log) -> bool:
model.set_param({"multi_strategy": "multi_output_tree"})
return False
booster = xgb.train(
{
"num_parallel_tree": num_parallel_tree,