MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / LoadFileToBoosting

Method LoadFileToBoosting

src/boosting/boosting.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool Boosting::LoadFileToBoosting(Boosting* boosting, const char* filename) {
21 auto start_time = std::chrono::steady_clock::now();
22 if (boosting != nullptr) {
23 TextReader<size_t> model_reader(filename, true);
24 size_t buffer_len = 0;
25 auto buffer = model_reader.ReadContent(&buffer_len);
26 if (!boosting->LoadModelFromString(buffer.data(), buffer_len)) {
27 return false;
28 }
29 }
30 std::chrono::duration<double, std::milli> delta = (std::chrono::steady_clock::now() - start_time);
31 Log::Debug("Time for loading model: %f seconds", 1e-3*delta);
32 return true;
33}
34
35Boosting* Boosting::CreateBoosting(const std::string& type, const char* filename) {
36 if (filename == nullptr || filename[0] == '\0') {

Callers

nothing calls this directly

Calls 3

dataMethod · 0.80
ReadContentMethod · 0.45
LoadModelFromStringMethod · 0.45

Tested by

no test coverage detected