Repository navigation
[DOC] Add DeepAR and NBeats usage examples - #2378
tomatotomata wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2378 +/- ##
=======================================
Coverage ? 88.82%
=======================================
Files ? 218
Lines ? 11671
Branches ? 0
=======================================
Hits ? 10367
Misses ? 1304
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
phoeenniixx
left a comment
There was a problem hiding this comment.
Thanks!
Can you please use dataset and show the complete flow of the model training and prediction in the example?
|
I expanded both model docstrings into runnable end-to-end examples using the built-in autoregressive dataset. Each now creates a The examples are in commit |
phoeenniixx
left a comment
There was a problem hiding this comment.
The code quality is still failing. Also, in place of adding a complete code block, can you add it command-wise? Using >>>? The doctests check >>> and not the code block
Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>
|
I checked the failing code-quality run and found one concrete ruff E501 in the DeepAR example. I also reworked both model examples from literal code blocks into |
phoeenniixx
left a comment
There was a problem hiding this comment.
The tests are still failing!
Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>
|
I traced the failing doctests on the current head and fixed the actual failure in Lightning was writing the progress bar and model summary to the doctest output, so both complete training examples failed even though the training itself finished. I disabled the progress bar and model summary in the example trainers while keeping the full dataset, fit, and prediction flow intact. Checks on the updated head:
Let me know what you think. |
Summary
This adds focused doctest-style usage examples for the v1
DeepARandNBeatsmodels and their package containers.The model examples show the supported
from_datasetentry point and link to the complete tutorials or example script. The package examples document the container-to-model resolution used by the estimator suite.This is intentionally limited to two v1 models, as requested in issue #2377. The remaining models can follow in separate small pull requests.
Validation
python -m ruff check pytorch_forecasting/models/deepar/_deepar.py pytorch_forecasting/models/deepar/_deepar_pkg.py pytorch_forecasting/models/nbeats/_nbeats.py pytorch_forecasting/models/nbeats/_nbeats_pkg.pypassed.python -m compileall -qpassed for the four changed files.git diff --checkpassed.lightningdependency is not installed.Closes #2377 for the DeepAR and NBeats slice.