-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
BacklogThis has a good chance to be implemented at some point.This has a good chance to be implemented at some point.Contributors welcome 👋🏻Especially relevant issue/PR for contributors to work on.Especially relevant issue/PR for contributors to work on.Other or internalIf no other grey tag is relevant or if issue from the MAPIE teamIf no other grey tag is relevant or if issue from the MAPIE team
Description
After investigating issue #484, I realized our implementation of the optimize_beta
option is incorrect, and has been from its introduction in MAPIE v0.4. See also issue #583.
Code to fix:
- In function
mapie.conformity_scores.regression.BaseRegressionScore.get_bounds
(the only place where beta optimization is performed), we pass a reshaped version of conformity scores to_beta_optimize
, and we probably should not.
if optimize_beta:
beta_np = self._beta_optimize(
alpha_np,
conformity_scores.reshape(1, -1),
conformity_scores.reshape(1, -1),
)
- The implementation of
_beta_optimize
seems OK-ish (see below). However, we getconformity_scores.reshape(1, -1)
for parameterslower_bounds
andupper_bounds
, and the reshape always produces arrays of shape (1, n), so the value oflen(lower_bounds)
is always 1. - In
_beta_optimize
, there may be an issue with the type of_alpha
in the enumerate. - In
_beta_optimize
, we distinguishlower_bounds
andupper_bounds
even though this value is the same, so it could be simplified.
After fixing this, we should:
- Implement tests to make sure
optimize_beta
works as expected - Verify example notebooks that are using this feature (are the results still consistent?)
- Make sure issue Error when computing multiple prediction intervals in Time Series Tutorial #484 is indeed fixed
The MAPIE core team is currently in discussion regarding the priority of this fix VS other ongoing developments. Contributions are welcome :)
Note: may be helpful: when using optimize_beta with a list of alphas, the prediction intervals shape is currently incorrect.
Metadata
Metadata
Assignees
Labels
BacklogThis has a good chance to be implemented at some point.This has a good chance to be implemented at some point.Contributors welcome 👋🏻Especially relevant issue/PR for contributors to work on.Especially relevant issue/PR for contributors to work on.Other or internalIf no other grey tag is relevant or if issue from the MAPIE teamIf no other grey tag is relevant or if issue from the MAPIE team