Small refinements for JSON model. (#5112)

* Naming consistency.

* Remove duplicated test.
This commit is contained in:
Jiaming Yuan
2019-12-11 19:49:01 +08:00
committed by GitHub
parent 208ab3b1ff
commit ad4a1c732c
7 changed files with 19 additions and 30 deletions

View File

@@ -40,7 +40,7 @@ void GBTreeModel::Load(dmlc::Stream* fi) {
void GBTreeModel::SaveModel(Json* p_out) const {
auto& out = *p_out;
CHECK_EQ(param.num_trees, static_cast<int>(trees.size()));
out["model_param"] = toJson(param);
out["gbtree_model_param"] = toJson(param);
std::vector<Json> trees_json;
size_t t = 0;
for (auto const& tree : trees) {
@@ -61,7 +61,7 @@ void GBTreeModel::SaveModel(Json* p_out) const {
}
void GBTreeModel::LoadModel(Json const& in) {
fromJson(in["model_param"], &param);
fromJson(in["gbtree_model_param"], &param);
trees.clear();
trees_to_update.clear();