Skip to content

Commit

Permalink
Fix training continuation with categorical model. (#7810)
Browse files Browse the repository at this point in the history
* Make sure the task is initialized before construction of tree updater.

This is a quick fix meant to be backported to 1.6, for a full fix we should pass the model
param into tree updater by reference instead.
  • Loading branch information
trivialfis authored Apr 15, 2022
1 parent 2d83b2a commit 5dea212
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/learner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ class LearnerConfiguration : public Learner {
obj_.reset(ObjFunction::Create(tparam_.objective, &generic_parameters_));
}
obj_->LoadConfig(objective_fn);
learner_model_param_.task = obj_->Task();

tparam_.booster = get<String>(gradient_booster["name"]);
if (!gbm_) {
Expand Down

0 comments on commit 5dea212

Please sign in to comment.