scikit-learn-contrib / MAPIE

A scikit-learn-compatible module to estimate prediction intervals and control risks based on conformal predictions.
https://mapie.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.27k stars 102 forks source link

Missing random state in Quantile Regression #405

Open gmartinonQM opened 8 months ago

gmartinonQM commented 8 months ago

I am trying to get reproducible results with MapieQuantileRegressor with the "split" method. Unfortunately :

TypeError: MapieQuantileRegressor.__init__() got an unexpected keyword argument 'random_state'

Whereas the attribute random_state is indeed used in the code of MapieQuantileRegressor, but always with the default value None. (https://github.com/scikit-learn-contrib/MAPIE/blob/2681b82dddbbdc59c3c30abd1de4e3d9a8f00935/mapie/regression/quantile_regression.py#L391)

Could you please add the random_state in the constructor of MapieQuantileRegressor ?

LacombeLouis commented 8 months ago

Hi @gmartinonQM, thank you for this information. If you want replicable results for the moment, I would suggest using the random_state in the .fit method. However, this is indeed something we should change to have it in the .__init__() of the method. Thank you!