| 228 | } |
| 229 | |
| 230 | void Refit(const int32_t* leaf_preds, int32_t nrow, int32_t ncol) { |
| 231 | std::lock_guard<std::mutex> lock(mutex_); |
| 232 | std::vector<std::vector<int32_t>> v_leaf_preds(nrow, std::vector<int32_t>(ncol, 0)); |
| 233 | for (int i = 0; i < nrow; ++i) { |
| 234 | for (int j = 0; j < ncol; ++j) { |
| 235 | v_leaf_preds[i][j] = leaf_preds[i * ncol + j]; |
| 236 | } |
| 237 | } |
| 238 | boosting_->RefitTree(v_leaf_preds); |
| 239 | } |
| 240 | |
| 241 | bool TrainOneIter(const score_t* gradients, const score_t* hessians) { |
| 242 | std::lock_guard<std::mutex> lock(mutex_); |
no test coverage detected