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

Function LGBM_BoosterPredictForCSRSingleRow

src/c_api.cpp:1386–1416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1384}
1385
1386int LGBM_BoosterPredictForCSRSingleRow(BoosterHandle handle,
1387 const void* indptr,
1388 int indptr_type,
1389 const int32_t* indices,
1390 const void* data,
1391 int data_type,
1392 int64_t nindptr,
1393 int64_t nelem,
1394 int64_t num_col,
1395 int predict_type,
1396 int num_iteration,
1397 const char* parameter,
1398 int64_t* out_len,
1399 double* out_result) {
1400 API_BEGIN();
1401 if (num_col <= 0) {
1402 Log::Fatal("The number of columns should be greater than zero.");
1403 } else if (num_col >= INT32_MAX) {
1404 Log::Fatal("The number of columns should be smaller than INT32_MAX.");
1405 }
1406 auto param = Config::Str2Map(parameter);
1407 Config config;
1408 config.Set(param);
1409 if (config.num_threads > 0) {
1410 omp_set_num_threads(config.num_threads);
1411 }
1412 Booster* ref_booster = reinterpret_cast<Booster*>(handle);
1413 auto get_row_fun = RowFunctionFromCSR(indptr, indptr_type, indices, data, data_type, nindptr, nelem);
1414 ref_booster->PredictSingleRow(num_iteration, predict_type, static_cast<int32_t>(num_col), get_row_fun, config, out_result, out_len);
1415 API_END();
1416}
1417
1418
1419int LGBM_BoosterPredictForCSC(BoosterHandle handle,

Callers

nothing calls this directly

Calls 4

RowFunctionFromCSRFunction · 0.70
omp_set_num_threadsFunction · 0.50
SetMethod · 0.45
PredictSingleRowMethod · 0.45

Tested by

no test coverage detected