fix: predict output quality — stray y, index-keyed intervals, horizon cap (#536) - #548
Closed
Shashankss1205 wants to merge 1 commit into
Closed
Shashankss1205 wants to merge 1 commit into
Shashankss1205 wants to merge 1 commit into
Conversation
… cap (#536) - NB-18: y was forwarded to every estimator's predict; forecasters raised a raw "unexpected keyword argument 'y'" TypeError. Pass y only when predict's signature accepts it (annotators); otherwise drop it and add a warning. - NB-21: predict_interval / predict_var serialized the DataFrame with orient="list", dropping the time index so values were bare arrays. Use orient="index" so every mode is index-keyed like predict. - NB-22: an unbounded horizon (e.g. 1000) returned all rows inline. Cap inline forecast rows at 500 with a predictions_truncated marker; normal horizons are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
Closing: this PR's content is already on main as commit 4d870f0 (identical patch-id; it was landed directly rather than through the PR merge button). Nothing further to merge. |
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.
Fixes #536. Three predict output-quality issues:
NB-18 — y forwarded to non-annotators (raw TypeError)
predict(..., y_dataset=...)on a forecaster raisedBaseForecaster.predict() got an unexpected keyword argument 'y'.yat predict is only for annotators/detectors; it's now passed only whenpredict's signature accepts it, and otherwise dropped with awarningsentry explaining why.NB-21 — interval/variance modes dropped the time index
predict_interval/predict_varserialized the DataFrame withorient="list", so values came back as bare arrays with no time labels — whilepredictkeys by period. Switched toorient="index", so every mode is index-keyed:NB-22 — unbounded horizon flooded the response
predict(horizon=1000)returned 1000 inline rows. Inline forecast rows are capped at 500 with apredictions_truncated: {shown, total, note}marker; normal horizons are never affected.Testing
tests/test_predict_output.py(5 tests): strayydropped with a warning (not a crash);predict_intervalandpredict_varare index-keyed dicts;horizon=1000capped with a marker;horizon=12untouched.🤖 Generated with Claude Code