LGBM_BoosterSaveModelToString

Function LGBM_BoosterSaveModelToString 

Source
pub unsafe extern "C" fn LGBM_BoosterSaveModelToString(
    handle: BoosterHandle,
    start_iteration: c_int,
    num_iteration: c_int,
    feature_importance_type: c_int,
    buffer_len: i64,
    out_len: *mut i64,
    out_str: *mut c_char,
) -> c_int
Expand description

Save model to string.

§Arguments

  • handle - Handle of booster
  • start_iteration - Start index of the iteration that should be saved
  • num_iteration - Index of the iteration that should be saved, <= 0 means save all
  • feature_importance_type - Type of feature importance, can be C_API_FEATURE_IMPORTANCE_SPLIT or C_API_FEATURE_IMPORTANCE_GAIN
  • buffer_len - String buffer length, if buffer_len < out_len, you should re-allocate buffer
  • out_len (direction out) - Actual output length
  • out_str (direction out) - String of model, should pre-allocate memory

§Returns

0 when succeed, -1 when failure happens