Repository navigation
Fix predict() silently falling back to the training series after fit(val_series) - #3279
Closed
XXXXXQ-0206 wants to merge 2 commits into
Closed
XXXXXQ-0206 wants to merge 2 commits into
XXXXXQ-0206 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
XXXXXQ-0206
force-pushed
the
fix-predict-val-series-warning
branch
from
October 24, 2026 04:30
66f65d2 to
2d176ce
Compare
Collaborator
|
Thanks for the PR @XXXXXQ-0206. I'll close this PR with the answer I gave here. |
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.
predict()withoutseriesfalls back totraining_series(documented in the docstring). Afterfit(train, val_series=val)wherevalcontinuestrain, that fallback excludes the validation part, so the forecast restarts inside the validation period - silently.Reproduction (0.48.1, master dcdde24, CPU):
This PR keeps the fallback and the returned start point unchanged (documented behaviour others rely on) and only makes it visible:
fit()records whether aval_seriesreached beyondtraining_series, andpredict()warns when it falls back, naming the training series, the resulting start and how to avoid it. The flag is recorded before the model is saved duringfit(), so it also survivessave()/load()andload_from_checkpoint(). Aval_seriesinside the training series, afit()withoutval_series, explicitseries=...,historical_forecasts()andbacktest()are unaffected.Test:
test_predict_without_series_warns_when_fitted_with_val_series(noval_series/ extending it / equal to it).Verification (local, CPU torch 2.14.1): new test: 3 cases pass; with
torch_forecasting_model.pyrestored to base they fail (1 failed, 2 passed); the full test file363 passed; pre-commit passes.AI disclosure: prepared with AI assistance under the account owner's direction; reproduction, tests and verification commands were run locally, outputs quoted verbatim.
Fixes #3278