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.2k stars 99 forks source link

Add random state to `MapieQuantileRegressor` constructor #424

Open tiagoleonmelo opened 3 months ago

tiagoleonmelo commented 3 months ago

Description

Allow users to pass random_state in MapieQuantileRegressor constructor.

When calling fit(), the following logic is applied:

My reasoning is that the random_state provided in fit will overwrite the one previously provided. This doesn't feel super intuitive to me (maybe the random state should not be passable now during fit to not have random state mismatches?), but I think it is better compared to the alternative

Fixes #405

Type of change

How Has This Been Tested?

Checklist

LacombeLouis commented 3 months ago

Hey @tiagoleonmelo, Thank you for this PR, note that it seems like the unit tests are not all passed. Make sure to check your linting ;) We will take a look at the PR as soon as all the tests have passed.

LacombeLouis commented 1 month ago

Hey @tiagoleonmelo, Thank you for this PR! For the moment it doesn't pass some tests, but we have fixed the issue. So you can git merge upstream/main and everything should work! Thank you!

tiagoleonmelo commented 1 month ago

Hey @LacombeLouis, sorry about the delay. I synced my fork, but still running into a few issues which I don't think come from my changes - getting a 404 somewhere