MCPcopy Create free account
hub / github.com/dmlc/xgboost / Save

Method Save

src/learner.cc:986–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984 }
985
986 void Save(dmlc::Stream* fo) const override {
987 this->CheckModelInitialized();
988
989 Json memory_snapshot{Object()};
990 memory_snapshot["Model"] = Object();
991 auto& model = memory_snapshot["Model"];
992 this->SaveModel(&model);
993 memory_snapshot["Config"] = Object();
994 auto& config = memory_snapshot["Config"];
995 this->SaveConfig(&config);
996
997 std::vector<char> stream;
998 Json::Dump(memory_snapshot, &stream, std::ios::binary);
999 fo->Write(stream.data(), stream.size());
1000 }
1001
1002 void Load(dmlc::Stream* fi) override {
1003 common::PeekableInStream fp(fi);

Callers 1

ResetMethod · 0.45

Calls 6

SaveModelMethod · 0.95
CheckModelInitializedMethod · 0.80
SaveConfigMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected