Parameter optimize_beta is not working #588
Labels
Contributors welcome 👋🏻
Especially relevant issue/PR for contributors to work on.
Discussion in progress
Discussion ongoing between the Mapie team and the author.
Other or internal
If no other grey tag is relevant or if issue from the MAPIE team
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:
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._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._beta_optimize
, there may be an issue with the type of_alpha
in the enumerate._beta_optimize
, we distinguishlower_bounds
andupper_bounds
even though this value is the same, so it could be simplified.After fixing this, we should:
optimize_beta
works as expectedThe 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.
The text was updated successfully, but these errors were encountered: