Skip to content

[ENH] Implement NBEATS in v2 - #2373

Open
Faakhir30 wants to merge 5 commits into
sktime:mainfrom
Faakhir30:nbeatsv2
Open

[ENH] Implement NBEATS in v2#2373
Faakhir30 wants to merge 5 commits into
sktime:mainfrom
Faakhir30:nbeatsv2

Conversation

@Faakhir30

@Faakhir30 Faakhir30 commented Aug 7, 2026

Copy link
Copy Markdown
Member

WIP

Reference Issues/PRs

What does this implement/fix? Explain your changes.

  • NBEATS adapter
  • NBEATS model

What should a reviewer concentrate their feedback on?

Did you add any tests for the change?

Any other comments?

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
  • Added/modified tests
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install.
    To run hooks independent of commit, execute pre-commit run --all-files

Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
@Faakhir30 Faakhir30 changed the title [ENH] Implement NBEATS in v2 [ENH] Implement NBEATS family in v2 Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.64865% with 113 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
...ch_forecasting/models/nbeats/_nbeats_adapter_v2.py 18.98% 64 Missing ⚠️
pytorch_forecasting/models/nbeats/_nbeats_v2.py 22.91% 37 Missing ⚠️
...ytorch_forecasting/models/nbeats/_nbeats_pkg_v2.py 42.85% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2373   +/-   ##
=======================================
  Coverage        ?   87.35%           
=======================================
  Files           ?      203           
  Lines           ?    11318           
  Branches        ?        0           
=======================================
  Hits            ?     9887           
  Misses          ?     1431           
  Partials        ?        0           
Flag Coverage Δ
cpu 87.35% <23.64%> (?)
pytest 87.35% <23.64%> (?)

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.

@phoeenniixx phoeenniixx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, I have a suggestion - can you please add one model per PR? this makes it easy to review.

Meaning please add NBEATSKAN and NBEATSx in separate PRs

@Faakhir30 Faakhir30 changed the title [ENH] Implement NBEATS family in v2 [ENH] Implement NBEATS in v2 Aug 19, 2026
@Faakhir30
Faakhir30 marked this pull request as ready for review August 19, 2026 01:57
@Faakhir30
Faakhir30 requested a review from phoeenniixx August 19, 2026 01:57
"generic": generic,
}

def training_step(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

are test_step etc not needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, test_step and validation_step should be implemented considering the backcast_loss thing. added now, mb

Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
@Faakhir30
Faakhir30 requested a review from phoeenniixx August 22, 2026 20:15

@phoeenniixx phoeenniixx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks,
Can you please add the docstrings - they are either missign or are incomplete (not explaining the class, method and (or) lacking the explaination of params)

ALso, i feel the adapter has soo much "AI" code, can you reduce the commetns (which are not needed, or atleast remove ---) And the format and explain the docstrings there



class NBeatsAdapterV2(TslibBaseModel):
"""Shared forward / training helpers for NBeats and NBeatsKAN (v2)."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think it will also be used for NBEATx or?

class NBeatsAdapterV2(TslibBaseModel):
"""Shared forward / training helpers for NBeats and NBeatsKAN (v2)."""

def __init__(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please docstrings

from pytorch_forecasting.models.base._tslib_base_model_v2 import TslibBaseModel


class NBeatsAdapterV2(TslibBaseModel):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be BaseModel no?

@phoeenniixx phoeenniixx added enhancement New feature or request module:models ptf-v2 Related to `pytorch-forecasting` v2 labels Aug 31, 2026
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 ptf-v2 Related to `pytorch-forecasting` v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants