| 1563 | } |
| 1564 | |
| 1565 | int LGBM_BoosterSaveModelToString(BoosterHandle handle, |
| 1566 | int start_iteration, |
| 1567 | int num_iteration, |
| 1568 | int64_t buffer_len, |
| 1569 | int64_t* out_len, |
| 1570 | char* out_str) { |
| 1571 | API_BEGIN(); |
| 1572 | Booster* ref_booster = reinterpret_cast<Booster*>(handle); |
| 1573 | std::string model = ref_booster->SaveModelToString(start_iteration, num_iteration); |
| 1574 | *out_len = static_cast<int64_t>(model.size()) + 1; |
| 1575 | if (*out_len <= buffer_len) { |
| 1576 | std::memcpy(out_str, model.c_str(), *out_len); |
| 1577 | } |
| 1578 | API_END(); |
| 1579 | } |
| 1580 | |
| 1581 | int LGBM_BoosterDumpModel(BoosterHandle handle, |
| 1582 | int start_iteration, |
no test coverage detected