Add Model and Configurable interface. (#4945)
* Apply Configurable to objective functions. * Apply Model to Learner and Regtree, gbm. * Add Load/SaveConfig to objs. * Refactor obj tests to use smart pointer. * Dummy methods for Save/Load Model.
This commit is contained in:
@@ -718,5 +718,13 @@ void Json::Dump(Json json, std::ostream *stream, bool pretty) {
|
||||
writer.Save(json);
|
||||
}
|
||||
|
||||
void Json::Dump(Json json, std::string* str, bool pretty) {
|
||||
GlobalCLocale guard;
|
||||
std::stringstream ss;
|
||||
JsonWriter writer(&ss, pretty);
|
||||
writer.Save(json);
|
||||
*str = ss.str();
|
||||
}
|
||||
|
||||
Json& Json::operator=(Json const &other) = default;
|
||||
} // namespace xgboost
|
||||
|
||||
Reference in New Issue
Block a user