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

Method SaveModelToFile

src/boosting/gbdt_model_text.cpp:379–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379bool GBDT::SaveModelToFile(int start_iteration, int num_iteration, const char* filename) const {
380 /*! \brief File to write models */
381 std::ofstream output_file;
382 output_file.open(filename, std::ios::out | std::ios::binary);
383 std::string str_to_write = SaveModelToString(start_iteration, num_iteration);
384 output_file.write(str_to_write.c_str(), str_to_write.size());
385 output_file.close();
386
387 return static_cast<bool>(output_file);
388}
389
390bool GBDT::SaveModelToFile(int start_iteration, int num_iteration,
391 int num_labels,

Callers 2

TrainMethod · 0.45
PredictMethod · 0.45

Calls 2

writeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected