Skip to content

[BUG] v2 PredictCallback.return_info misreads batched y and index metadata - #2401

Open
victorwon2001 wants to merge 2 commits into
sktime:mainfrom
victorwon2001:fix/issue-2156
Open

[BUG] v2 PredictCallback.return_info misreads batched y and index metadata#2401
victorwon2001 wants to merge 2 commits into
sktime:mainfrom
victorwon2001:fix/issue-2156

Conversation

@victorwon2001

@victorwon2001 victorwon2001 commented Sep 2, 2026

Copy link
Copy Markdown
LLM generated content, by GPT-5.6 Sol

Reference Issues/PRs

Fixes #2156

What does this implement/fix? Explain your changes.

Corrects v2 prediction metadata so return_info returns the full target batch, a prediction index derived from the active dataset, and consistent prediction lengths across the supported data modules.

What should a reviewer concentrate their feedback on?

Whether the returned index matches the intended v2 prediction contract.

Did you add any tests for the change?

Yes. Focused regression tests cover batched and multi-target targets, prediction indices, and both v2 data paths. The affected suites and pre-commit checks pass.

Any other comments?

None.

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG].
  • Added/modified tests
  • Used pre-commit hooks.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.76744% with 26 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@67c354f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...h_forecasting/data/tests/test_tslib_data_module.py 0.00% 18 Missing ⚠️
pytorch_forecasting/callbacks/predict.py 86.66% 4 Missing ⚠️
...forecasting/data/data_module/_tslib_data_module.py 86.66% 2 Missing ⚠️
...g/data/data_module/_encoder_decoder_data_module.py 93.33% 1 Missing ⚠️
...asting/tests/test_all_v2/test_all_estimators_v2.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2401   +/-   ##
=======================================
  Coverage        ?   88.06%           
=======================================
  Files           ?      200           
  Lines           ?    11242           
  Branches        ?        0           
=======================================
  Hits            ?     9900           
  Misses          ?     1342           
  Partials        ?        0           
Flag Coverage Δ
cpu 88.06% <69.76%> (?)
pytest 88.06% <69.76%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@victorwon2001

Copy link
Copy Markdown
Author

Updated both v2 tutorial prediction examples to read the returned index as a DataFrame row and display time_idx/series_id metadata. The corrected notebook executes successfully, notebook pre-commit checks pass, and the 307-test affected regression suite passes. The full tutorial runner also gets past this notebook; the local run subsequently hit an unrelated 1200-second timeout in stallion.ipynb's CPU training cell.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] v2 PredictCallback.return_info misreads batched y and index metadata

1 participant