Skip to content
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

Support for LGBM Booster models #403

Open
caeduft opened this issue Jan 19, 2024 · 1 comment
Open

Support for LGBM Booster models #403

caeduft opened this issue Jan 19, 2024 · 1 comment
Labels
Enhancement Type: enhancement (new feature or request) Needs decision The MAPIE team is deciding what to do next. Other or internal If no other grey tag is relevant or if issue from the MAPIE team Source: contributors Proposed by contributors.

Comments

@caeduft
Copy link

caeduft commented Jan 19, 2024

Conformal prediction in MAPIE using existing models (e.g. https://mapie.readthedocs.io/en/latest/examples_regression/1-quickstart/plot_prefit.html#sphx-glr-examples-regression-1-quickstart-plot-prefit-py) supports models which have fit and predict attributes only. However, LGBM Regression models saved to disk, either using Booster method or pickle, don't have a "fit" attribute but a "refit" attribute (https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.Booster.html#lightgbm.Booster.refit). Unfortunately, MAPIE seems unable to use the refit method. Therefore, at this point, an LGBM Booster instance seems to be incompatible with MAPIE.

Enabling compatibility between LGBM Booster and MAPIE could be very useful for instances where a model is reused multiple times for prediction in the future and fitting a model from scratch is not possible.

@caeduft caeduft added the Enhancement Type: enhancement (new feature or request) label Jan 19, 2024
@LacombeLouis
Copy link
Collaborator

Hey @caeduft, thank you for your message. So indeed, this is something that could be fixed using a wrapper and naming the refit method fit. Please checkout issue #340 where we give an example of this. Note that you will only be able to use a split setting.

This is indeed something we want to fix more generally by giving more examples of this in the documentation, so do not hesitate to share your code afterwards!

@thibaultcordier thibaultcordier added the Source: contributors Proposed by contributors. label Mar 1, 2024
@jawadhussein462 jawadhussein462 added Discussion in progress Discussion ongoing between the Mapie team and the author. Other or internal If no other grey tag is relevant or if issue from the MAPIE team Needs decision The MAPIE team is deciding what to do next. and removed Discussion in progress Discussion ongoing between the Mapie team and the author. labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Type: enhancement (new feature or request) Needs decision The MAPIE team is deciding what to do next. Other or internal If no other grey tag is relevant or if issue from the MAPIE team Source: contributors Proposed by contributors.
Projects
None yet
Development

No branches or pull requests

4 participants