[ENH] Add v2 interface support for N-BEATS model#2322
Open
harshsomankar123-tech wants to merge 4 commits into
Open
[ENH] Add v2 interface support for N-BEATS model#2322harshsomankar123-tech wants to merge 4 commits into
harshsomankar123-tech wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2322 +/- ##
=======================================
Coverage ? 87.41%
=======================================
Files ? 169
Lines ? 9965
Branches ? 0
=======================================
Hits ? 8711
Misses ? 1254
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #2034.
What does this implement/fix? Explain your changes.
This PR adds v2 interface support for the N-BEATS model, following the v2 patterns recently established by DLinear, SAMformer, and TFT in the codebase.
Specifically, this implements:
pytorch_forecasting/models/nbeats/_nbeats_v2.py): * ImplementedNBeatsinheriting from the experimentalBaseModelv2.context_length) and horizon (prediction_length).backcast_loss_ratio > 0.plot_interpretation) and scaling transformation (transform_output).pytorch_forecasting/models/nbeats/_nbeats_pkg_v2.py&__init__.py): * Created package containerNBeats_pkg_v2inheriting fromBase_pkgto represent the high-level workflow wrapper.get_test_train_params).What should a reviewer concentrate their feedback on?
BaseModel(v2) andBase_pkgclasses.get_test_train_paramsadequately covers required testing configurations for the package wrapper.Did you add any tests for the change?
Yes. Robust test coverage was added in
tests/test_models/test_nbeats_v2.py.The new tests cover initialization, forward pass configurations, quantile loss output shapes, step functions (training, validation, test), packaging/fitting pipelines, and interpretation plotting (including matplotlib soft-dependency checking).
Verification: All new v2 tests (7 passes, 1 skipped due to matplotlib missing) and legacy v1 tests (2 passes, 1 skipped) execute successfully without regressions.
Any other comments?
N/A
PR checklist
pre-commit install.To run hooks independent of commit, execute
pre-commit run --all-files