MAPIE
MAPIE copied to clipboard
The base model does not seem to be accepted by MapieQuantileRegressor
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:
- After the code I use (see screenshot below), this is the error that comes up.
- 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 toquantile_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:
Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome
- MAPIE Version: 0.4.1
Thanks for the help!
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.
Ok, thanks for the clarification and help!