Additional tests for attributes and model booosted rounds. (#9962)

This commit is contained in:
Jiaming Yuan
2024-01-09 09:54:39 +08:00
committed by GitHub
parent bed0349954
commit 2f57bbde3c
3 changed files with 90 additions and 30 deletions

View File

@@ -535,8 +535,7 @@ class LearnerConfiguration : public Learner {
tparam_.booster = get<String>(gradient_booster["name"]);
if (!gbm_) {
gbm_.reset(GradientBooster::Create(tparam_.booster,
&ctx_, &learner_model_param_));
gbm_.reset(GradientBooster::Create(tparam_.booster, &ctx_, &learner_model_param_));
}
gbm_->LoadConfig(gradient_booster);
@@ -1095,6 +1094,11 @@ class LearnerIO : public LearnerConfiguration {
std::vector<std::pair<std::string, std::string> > extra_attr;
mparam.contain_extra_attrs = 1;
if (!this->feature_names_.empty() || !this->feature_types_.empty()) {
LOG(WARNING) << "feature names and feature types are being disregarded, use JSON/UBJSON "
"format instead.";
}
{
// Similar to JSON model IO, we save the objective.
Json j_obj { Object() };