[python-package] What is the best way for Booster to fit the Booster model to residuals?
I am trying to convert the DecisionTreeClassifier model by SciKit Learn to LGBM using the existing model specs. The only problem is that I would have to import the lgbm model using lgb.Booster, but this doesn't have the '.fit()' feature that Scikit-learn provides. What is the best alternative for the LGBM Booster model? refit, retrain, or update? Is there a way to replicate the model by using lightgbm.lgbmclassifier? Thanks,
Thanks for using LightGBM!
The lightgbm Python package has a scikit-learn compatible interface.
See this example:
https://github.com/microsoft/LightGBM/blob/c2d2c99f44dcaad1f6dfc05d877e47aad13ddfc9/examples/python-guide/sklearn_example.py#L24-L30
and the docs at https://lightgbm.readthedocs.io/en/v3.3.4/pythonapi/lightgbm.LGBMClassifier.html
Is there a way to access each individual tree and fit each tree separately? for Booster or sklearn LGBM?
@johnkimdy what do you mean by "fit each tree separately", exactly?
LightGBM training builds an ensemble of trees.
@johnkimdy what do you mean by "fit each tree separately", exactly?
LightGBM training builds an ensemble of trees.
can we run LGBMRegressor iteratively for each individual tree to replicate lgb.train? Is LGBMRegressor the counterpart of decisiontreeregressor in sklearn?
@johnkimdy sorry for the delayed response.
No, LGBMRegressor.fit() fits an ensemble of trees, meaning a collection of multiple trees whose output is combined to produce a prediction.
The closest equivalent in scikit-learn is sklearn.ensemble.HistGradientBoostingRegressor (docs).
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM!
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.