Skip to content

Commit

Permalink
Check correct dump format for gblinear.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 19, 2024
1 parent 15c6172 commit 41183d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gbm/gblinear_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
Expand Down

0 comments on commit 41183d6

Please sign in to comment.