MAPIE icon indicating copy to clipboard operation
MAPIE copied to clipboard

Add CatBoostRegressor to MapieQuantileRegressor class

Open fjpa121197 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently, I'm using CatBoost regressor for a regression problem, where this model seems to give best performance. Right now, I'm looking to produce prediction intervals, and would like to stick with the same model, and at the same time, make use of MAPIE and not make separate models in code.

Describe the solution you'd like Use CatBoost regressor with CQR.

Describe alternatives you've considered Solution is not using MAPIE and create 2 additional models and follow same approach to calculate q, and then form the sets. Other is to modify code base and add CatBoost regressor support, but not really good at coding, still understanding quantile_regression.py file, to see how to add CatBoost, since I think, the only way to use quantile loss function and alpha, is by setting them both values in the same string like this: model = catboost.CatBoostRegressor(loss_function='Quantile:alpha=0.95', ...)

*I can maybe take a look at it and work on it, but will take time. It would be a good first contribution to do for me :)

Thanks in advance,

fjpa121197 avatar Aug 19 '22 07:08 fjpa121197

Hi @fjpa121197 ! Indeed, MapieQuantileRegressor does not accept CatBoostRegressor at the moment. A workaround is to modify the quantile_estimator_params attribute to include this class as a new key. The problem is that both the "quantile" objective and the "alpha" value are defined in the same loss_function argument, which is not taken into account in MAPIE at the moment. @LacombeLouis , do you think it can be easily added ?

vtaquet avatar Aug 22 '22 09:08 vtaquet

Hey @vtaquet and @fjpa121197, we are currently creating a cv="prefit" method where you will be able to pre-train your models and then use those directly with MapieQuantileRegressor() (PR#214). For the moment, having a built-in solution will not be our main focus, but if you want to contribute, I suggest you follow the guidelines for contributing and we will be delighted to help you with this process.

LacombeLouis avatar Aug 29 '22 14:08 LacombeLouis