| 18 | } |
| 19 | |
| 20 | bool 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 | |
| 35 | Boosting* Boosting::CreateBoosting(const std::string& type, const char* filename) { |
| 36 | if (filename == nullptr || filename[0] == '\0') { |
nothing calls this directly
no test coverage detected