fix: raise ValueError for h>1 in forecast_fitted_values#1082
Open
GauravPatil2515 wants to merge 1 commit intoNixtla:mainfrom
Open
fix: raise ValueError for h>1 in forecast_fitted_values#1082GauravPatil2515 wants to merge 1 commit intoNixtla:mainfrom
GauravPatil2515 wants to merge 1 commit intoNixtla:mainfrom
Conversation
Fixes Nixtla#1032 - Add h parameter (default=1) to forecast_fitted_values - Raise ValueError with guidance when h>1 - Add regression tests
|
|
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 #1032
Description
This PR addresses the issue where forecast_fitted_values silently ignores multi-step expectations or behaves ambiguously when users try to generate in-sample forecasts for
h > 1.Forecast fitted values are conceptually 1-step-ahead predictions. To prevent user confusion and incorrect usage, this change makes the restriction explicit.
Changes
_StatsForecast.forecast_fitted_valuesandStatsForecast.forecast_fitted_valuesto accept anhparameter (defaulting to1).ValueErrorifh > 1. The error message guides new users to use cross_validation or forecast() for multi-step predictions.h=1works as expected (default logic preserved).h>1correctly raisesValueError.Checklist
hparameter andValueError