-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading model from txt file in Sklearn API #5552
Comments
Hi @gverbock, thanks for using LightGBM. Can you share more details about why you need the scikit-learn interface for inference? |
Sure, the modelling pipeline I am using is based on the scikit-learn interface and I plug-in different types of model depending on the needs and regulatory requirements (logistic regression, random forest, ...). Using the scikit-learn interface allows me to use LightGBM without changing the current pipeline. I noticed a significant improvement when using LightGBM on some parts of the modelling pipeline so I really want to use it. So far my options to use LightGBM are:
|
I see. Assigning those internal attributes may break again in the feature, but if you're that restricted and that has been working for you so far, the change needed for your example to work is setting @jameslamb what do you think of this as a feature request? xgboost reference. |
Sorry for taking so long to get back to this @jmoralez ! I'd support adding the ability to initialize the scikit-learn classes from a model in text format. Following the API that xgboost set up (thanks for the link!) looks ok to me. If you or anyone else reading this opens a pull request, I'd also ask that you consider:
|
I've added this to #2302, where we track all feature requests. Given that, I'm going to close this for now. Anyone is welcome to contribute this feature! And it can be re-opened for discussion if there are design decisions to be made before opening a PR or if a contributor needs help with the contribution process. @gverbock thanks for describing this feature and for using LightGBM! Just to be sure we set the right expectation... this project is suffering from a serious lack of maintainer availability and attention these days. The fastest way to get LightGBM to adopt this behavior is to implement it yourself and propose a pull request. Otherwise, stay subscribed to this and you'll be notified if someone starts working on it. |
Description
Starting from version 3.3.1, the code I use to read a booster from a txt file and include it into a LGBMClassifier is not working anymore. I am wondering if this is a side effect of another change or something make on purpose.
Reproducible example
It works with 3.3.0
But not with 3.3.1, 3.3.2 and 3.3.3
![image](https://user-images.githubusercontent.com/32060943/196959880-51179189-7e4e-4385-ba8c-f3af47dda12e.png)
Additional Comments
The text was updated successfully, but these errors were encountered: