Skip to content

Conversation

phoeenniixx
Copy link
Member

This PRs adds the predict function and related functionality to v2
Fixes #1883

  • Add PredictCallback
  • Add Base_pkg class and predict wrapper
  • Add tests for predict
  • Add tests for checkpointing
  • Add support of yml file reading for cfgs (similar to pytorch-tabular)

@fkiraly fkiraly added enhancement New feature or request module:models labels Oct 18, 2025
@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 81.13208% with 50 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@d4596de). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pytorch_forecasting/base/_base_pkg.py 76.23% 24 Missing ⚠️
pytorch_forecasting/callbacks/predict.py 64.28% 20 Missing ⚠️
pytorch_forecasting/models/base/_base_model_v2.py 77.27% 5 Missing ⚠️
...ytorch_forecasting/tests/test_all_estimators_v2.py 96.55% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1984   +/-   ##
=======================================
  Coverage        ?   86.17%           
=======================================
  Files           ?      162           
  Lines           ?     9600           
  Branches        ?        0           
=======================================
  Hits            ?     8273           
  Misses          ?     1327           
  Partials        ?        0           
Flag Coverage Δ
cpu 86.17% <81.13%> (?)
pytest 86.17% <81.13%> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

Configs to initialise ``lightning.Trainer``. Defaults to {}.
datamodule_cfg : Union[dict, str, Path], optional
Configs to initialise a ``LightningDataModule``.
- If dict, the keys and values are used as configuration parameters.
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor formatting issue: please have newlines around bullet point lists

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Extremely neat!

I like the design, and I think this is brilliantly done!

Some questions and requests:

  • could you write a summary for the PR?
  • could you add a vignette somewhere in a notebook or an "examples" section? I think this is crucial to have a full review.
  • can you explain how or why the test configs can be replaced by a single test vignette?
  • design questions: why are fit and predict kwargs there and not in __init__? Have you thought about this?

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

Labels

enhancement New feature or request module:models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] v2 interface design - output (predict, backtesting etc) interface

2 participants