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

The base model does not seem to be accepted by MapieQuantileRegressor #199

Closed
masakljun opened this issue Jul 11, 2022 · 2 comments
Closed

Comments

@masakljun
Copy link

Describe the bug
I am trying to use my XGBoost model in combination with MapieQuantileRegressor. However, the error below comes up when I try to set estimator = my_xgboost_model

To Reproduce
Steps to reproduce the behavior:

  1. After the code I use (see screenshot below), this is the error that comes up.
  2. ValueError: The base model does not seem to be accepted by MapieQuantileRegressor.
    Give a base model among:
    quantile_estimator_params.keys()Or, add your base model to quantile_estimator_params.

Expected behavior
I see from the error that I should somehow add my model to the quantile_estimator_params, but I don't know how to do that.

Screenshots
The relevant part of the code:
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • MAPIE Version: 0.4.1

Thanks for the help!

@masakljun masakljun added the bug label Jul 11, 2022
@LacombeLouis
Copy link
Collaborator

Hey @masakljun! It's important that for MapieQuantileRegressor you provide an estimator that can perform quantile regression. As such, I would suggest using LGBMRegressor(objective='quantile', alpha=0.5) or GradientBoostingRegressor(loss="quantile).

If you need to use XGBRegressor, you need to implement a quantile method as suggested in this article. Note that you would need to fit a wrapper on this method and add it to the MapieQuantileRegressor().quantile_estimator_params by defining the loss_name and alpha_name for that estimator.

@masakljun
Copy link
Author

Ok, thanks for the clarification and help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants