Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
lightgbm.basic._InnerPredictor Class Reference
Inheritance diagram for lightgbm.basic._InnerPredictor:

Public Member Functions

 __init__ (self, model_file=None, booster_handle=None, pred_parameter=None)
 
 __del__ (self)
 
 __getstate__ (self)
 
 predict (self, data, num_iteration=-1, raw_score=False, pred_leaf=False, pred_contrib=False, data_has_header=False, is_reshape=True)
 

Data Fields

 handle
 
 num_class
 
 num_total_iteration
 
 pandas_categorical
 
 pred_parameter
 

Detailed Description

_InnerPredictor of LightGBM.

Not exposed to user.
Used only for prediction, usually used for continued training.

Note
----
Can be converted from Booster, but cannot be converted to Booster.

Constructor & Destructor Documentation

◆ __init__()

lightgbm.basic._InnerPredictor.__init__ (   self,
  model_file = None,
  booster_handle = None,
  pred_parameter = None 
)
Initialize the _InnerPredictor.

Parameters
----------
model_file : string or None, optional (default=None)
    Path to the model file.
booster_handle : object or None, optional (default=None)
    Handle of Booster.
pred_parameter: dict or None, optional (default=None)
    Other parameters for the prediciton.

Member Function Documentation

◆ predict()

lightgbm.basic._InnerPredictor.predict (   self,
  data,
  num_iteration = -1,
  raw_score = False,
  pred_leaf = False,
  pred_contrib = False,
  data_has_header = False,
  is_reshape = True 
)
Predict logic.

Parameters
----------
data : string, numpy array, pandas DataFrame, H2O DataTable or scipy.sparse
    Data source for prediction.
    When data type is string, it represents the path of txt file.
num_iteration : int, optional (default=-1)
    Iteration used for prediction.
raw_score : bool, optional (default=False)
    Whether to predict raw scores.
pred_leaf : bool, optional (default=False)
    Whether to predict leaf index.
pred_contrib : bool, optional (default=False)
    Whether to predict feature contributions.
data_has_header : bool, optional (default=False)
    Whether data has header.
    Used only for txt data.
is_reshape : bool, optional (default=True)
    Whether to reshape to (nrow, ncol).

Returns
-------
result : numpy array
    Prediction result.

The documentation for this class was generated from the following file: