metarank / lightgbm4j

Java LightGBM binding
MIT License
57 stars 10 forks source link

Does it support the 'pred_leaf' function of lightgbm? #59

Closed ToUranus closed 2 years ago

ToUranus commented 2 years ago

When I use lightgbm, I not only want to predict the classification result and probability value of the instance, I want to get the binary features of the tree model, which is convenient for the subsequent input of the logistic regression algorithm (GBDT+LR), so I want to ask if there are parameters similar to extracting native the 'pred_leaf' parameter in the lightgbm interface.thanks for your answer

shuttie commented 2 years ago

Are you talking about this method: https://lightgbm.readthedocs.io/en/latest/C-API.html#c.LGBM_BoosterGetLeafValue ?

ToUranus commented 2 years ago

Are you talking about this method: https://lightgbm.readthedocs.io/en/latest/C-API.html#c.LGBM_BoosterGetLeafValue ?

no,this method:https://lightgbm.readthedocs.io/en/latest/Parameters.html?highlight=predict#predict-parameters

parameter: predict_leaf_index

just in predictict params, I want to get every predictions are in which leaf(leaf index).