Check correct dump format for gblinear. (#10831)

This commit is contained in:
Jiaming Yuan
2024-09-21 00:32:52 +08:00
committed by GitHub
parent 24241ed6e3
commit 2a37a8880c
2 changed files with 20 additions and 10 deletions

View File

@@ -125,7 +125,7 @@ class GBLinearModel : public Model {
}
}
fo << std::endl << " ]" << std::endl << " }";
} else {
} else if (format == "text") {
fo << "bias:\n";
for (int gid = 0; gid < ngroup; ++gid) {
fo << this->Bias()[gid] << std::endl;
@@ -136,6 +136,8 @@ class GBLinearModel : public Model {
fo << (*this)[i][gid] << std::endl;
}
}
} else {
LOG(FATAL) << "Dump format `" << format << "` is not supported by the gblinear model.";
}
std::vector<std::string> v;
v.push_back(fo.str());