| 1183 | } |
| 1184 | |
| 1185 | int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle, |
| 1186 | const float* grad, |
| 1187 | const float* hess, |
| 1188 | int* is_finished) { |
| 1189 | API_BEGIN(); |
| 1190 | Booster* ref_booster = reinterpret_cast<Booster*>(handle); |
| 1191 | #ifdef SCORE_T_USE_DOUBLE |
| 1192 | Log::Fatal("Don't support custom loss function when SCORE_T_USE_DOUBLE is enabled"); |
| 1193 | #else |
| 1194 | if (ref_booster->TrainOneIter(grad, hess)) { |
| 1195 | *is_finished = 1; |
| 1196 | } else { |
| 1197 | *is_finished = 0; |
| 1198 | } |
| 1199 | #endif |
| 1200 | API_END(); |
| 1201 | } |
| 1202 | |
| 1203 | int LGBM_BoosterUpdateOneIterCustom2(BoosterHandle handle, |
| 1204 | const float* grad, |
no test coverage detected