LGBM_BoosterPredictForFile

Function LGBM_BoosterPredictForFile 

Source
pub unsafe extern "C" fn LGBM_BoosterPredictForFile(
    handle: BoosterHandle,
    data_filename: *const c_char,
    data_has_header: c_int,
    predict_type: c_int,
    start_iteration: c_int,
    num_iteration: c_int,
    parameter: *const c_char,
    result_filename: *const c_char,
) -> c_int
Expand description

Make prediction for file.

§Arguments

  • handle - Handle of booster
  • data_filename - Filename of file with data
  • data_has_header - Whether file has header or not
  • predict_type - What should be predicted
  • C_API_PREDICT_NORMAL: normal prediction, with transform (if needed);
  • C_API_PREDICT_RAW_SCORE: raw score;
  • C_API_PREDICT_LEAF_INDEX: leaf index;
  • C_API_PREDICT_CONTRIB: feature contributions (SHAP values)
  • start_iteration - Start index of the iteration to predict
  • num_iteration - Number of iterations for prediction, <= 0 means no limit
  • parameter - Other parameters for prediction, e.g. early stopping for prediction
  • result_filename - Filename of result file in which predictions will be written

§Returns

0 when succeed, -1 when failure happens