_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.
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.