[][src]Function lightgbm_sys::LGBM_BoosterPredictForCSRSingleRowFast

pub unsafe extern "C" fn LGBM_BoosterPredictForCSRSingleRowFast(
    fastConfig_handle: FastConfigHandle,
    indptr: *const c_void,
    indptr_type: c_int,
    indices: *const i32,
    data: *const c_void,
    nindptr: i64,
    nelem: i64,
    out_len: *mut i64,
    out_result: *mut f64
) -> c_int

\brief Faster variant of LGBM_BoosterPredictForCSRSingleRow.

Score single rows after setup with LGBM_BoosterPredictForCSRSingleRowFastInit.

By removing the setup steps from this call extra optimizations can be made like initializing the config only once, instead of once per call.

\note Setting up the number of threads is only done once at LGBM_BoosterPredictForCSRSingleRowFastInit instead of at each prediction. If you use a different number of threads in other calls, you need to start the setup process over, or that number of threads will be used for these calls as well.

\note You should pre-allocate memory for out_result:

  • for normal and raw score, its length is equal to num_class * num_data;
  • for leaf index, its length is equal to num_class * num_data * num_iteration;
  • for feature contributions, its length is equal to num_class * num_data * (num_feature + 1).

\param fastConfig_handle FastConfig object handle returned by LGBM_BoosterPredictForCSRSingleRowFastInit \param indptr Pointer to row headers \param indptr_type Type of indptr, can be C_API_DTYPE_INT32 or C_API_DTYPE_INT64 \param indices Pointer to column indices \param data Pointer to the data space \param nindptr Number of rows in the matrix + 1 \param nelem Number of nonzero elements in the matrix \param[out] out_len Length of output result \param[out] out_result Pointer to array with predictions \return 0 when succeed, -1 when failure happens