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

Allow `MapieRegressor` to use the optimal estimation strategy for the bounds of the prediction intervals #387

Closed thibaultcordier closed 6 months ago

thibaultcordier commented 6 months ago

Description

In the MAPIE code, only the predict method of MapieTimeSeriesRegressor class can use optimize_beta to optimize the bounds of the prediction interval.

Propose the integration of the same feature into the MapieRegressor class (deleguate this feature in ConformityScore class). Merge the two predict methods to create a single method for easier maintenance.

Fixes #384 Fixes #389

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (614293e) 100.00% compared to head (c2df197) 100.00%. Report is 24 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #387 +/- ## ========================================== Coverage 100.00% 100.00% ========================================== Files 39 39 Lines 4616 4616 Branches 487 758 +271 ========================================== Hits 4616 4616 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

thibaultcordier commented 6 months ago

Note: after this PR, we should open an issue to remove MapieRegressor warning when using this strategy and add an example of how to use this feature.

thibaultcordier commented 6 months ago

This PR proposes solution for issue #389.