diff --git a/AUTHORS.rst b/AUTHORS.rst index 8fcded38..0f08fa95 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -42,4 +42,5 @@ Contributors * Ambros Marzetta * Carl McBride Ellis * Baptiste Calot +* Mohammed Jawhar To be continued ... diff --git a/HISTORY.rst b/HISTORY.rst index f57c47de..97c10c20 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,7 @@ History ------------------ * Bump wheel version to avoid known security vulnerabilities +* Fix issue 495 to center correctly the prediction intervals 0.9.1 (2024-09-13) ------------------ diff --git a/mapie/estimator/regressor.py b/mapie/estimator/regressor.py index a200586c..3ec9a66e 100644 --- a/mapie/estimator/regressor.py +++ b/mapie/estimator/regressor.py @@ -565,13 +565,17 @@ def predict( elif self.method == "plus": y_pred_multi_low = y_pred_multi y_pred_multi_up = y_pred_multi - else: + elif self.method != "enbpi": y_pred_multi_low = y_pred[:, np.newaxis] y_pred_multi_up = y_pred[:, np.newaxis] if ensemble: y_pred = aggregate_all(self.agg_function, y_pred_multi) + if self.method == "enbpi": + y_pred_multi_low = y_pred[:, np.newaxis] + y_pred_multi_up = y_pred[:, np.newaxis] + if return_multi_pred: return y_pred, y_pred_multi_low, y_pred_multi_up else: