Skip to content

[BUG] fix predict_quantiles default from predict_interval mixing up variables for multioutput y - #1211

Merged
fkiraly merged 2 commits into
sktime:mainfrom
VividhDesign:fix-quantiles-from-interval-multioutput
Oct 11, 2026
Merged

fkiraly merged 2 commits into
sktime:mainfrom
VividhDesign:fix-quantiles-from-interval-multioutput

Conversation

@VividhDesign

@VividhDesign VividhDesign commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Same bug as sktime/sktime#11423, fixed in sktime/sktime#11424. Opened following @fkiraly's review there, which pointed out that skpro has identical code. Fixes #1212.

What does this implement/fix? Explain your changes.

In BaseProbaRegressor._predict_quantiles, when only _predict_interval is implemented, quantiles were assigned to the wrong variables for multioutput y.

  • The intervals are computed per alpha and concatenated, which gives column order alpha → variable → lower/upper.
  • The positional selector assumed variable → alpha → lower/upper.
  • The two agree only for a single variable.

Now, for each alpha, the lower or upper end is selected by label (xs), and the columns are then reordered to variable-major order by position. This stays in pandas, so the dtypes returned by _predict_interval are preserved. That matters for pandas 2.0: going through .values turns nullable Float64 columns into object, which broke the first version of the sktime PR on the old dependency set.

No skpro estimator currently hits this, since the interval-only regressors (MAPIE adapters) are single-output. It does affect any multioutput regressor that implements only _predict_interval.

Does your contribution introduce a new dependency? If yes, which one?

No.

What should a reviewer concentrate their feedback on?

The rewritten block in skpro/regression/base/_base.py.

Did you add any tests for the change?

Yes, skpro/regression/tests/test_quantiles_from_interval.py. It uses a dummy 3-output regressor with known per-variable interval widths, and fails on main.

Passing locally:

  • skpro/regression and skpro/metrics (819 tests), with the current dependencies;
  • test_all_regressors plus the new test (540 tests), on the 2023-07 set (pandas 2.0.3, numpy 1.25.0, scikit-learn 1.3.0).

Any other comments?

(AI-assisted; reviewed and tested by me.)

PR checklist

  • The PR title starts with [BUG]

@VividhDesign

Copy link
Copy Markdown
Contributor Author

Update, following @fkiraly's review on sktime/sktime#11424:

  • the default now calls _predict_interval once, with all unique coverages, instead of once per alpha;
  • column positions are computed with numpy from the documented (variable, coverage, lower/upper) order;
  • the final subsetting is a pandas iloc, so dtypes are preserved.

Tests pass with current deps (skpro/regression, skpro/metrics) and with the 2023-07 set (test_all_regressors plus the new test).

(AI-assisted; reviewed and tested by me.)

@fkiraly fkiraly added bug module:regression probabilistic regression module labels Oct 11, 2026

@fkiraly fkiraly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@fkiraly
fkiraly merged commit 1462eee into sktime:main Oct 11, 2026
47 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug module:regression probabilistic regression module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Check if _predict_quantiles default has the same bug as in sktime - if so, fix

2 participants