| 377 | } |
| 378 | |
| 379 | bool 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 | |
| 390 | bool GBDT::SaveModelToFile(int start_iteration, int num_iteration, |
| 391 | int num_labels, |