Merge model compatibility fixes from 1.0rc branch. (#5305)

* Port test model compatibility.
* Port logit model fix.

https://github.com/dmlc/xgboost/pull/5248
https://github.com/dmlc/xgboost/pull/5281
This commit is contained in:
Jiaming Yuan
2020-02-13 20:41:59 +08:00
committed by GitHub
parent 29eeea709a
commit 911a902835
19 changed files with 550 additions and 106 deletions

View File

@@ -24,7 +24,7 @@ void JsonWriter::Visit(JsonArray const* arr) {
for (size_t i = 0; i < size; ++i) {
auto const& value = vec[i];
this->Save(value);
if (i != size-1) { Write(", "); }
if (i != size-1) { Write(","); }
}
this->Write("]");
}
@@ -38,7 +38,7 @@ void JsonWriter::Visit(JsonObject const* obj) {
size_t size = obj->getObject().size();
for (auto& value : obj->getObject()) {
this->Write("\"" + value.first + "\": ");
this->Write("\"" + value.first + "\":");
this->Save(value.second);
if (i != size-1) {