Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lags=0 in linear_model Class for Standard Regression Functionality #205

Open
jhug12 opened this issue Apr 23, 2024 · 1 comment · May be fixed by #214
Open

Allow lags=0 in linear_model Class for Standard Regression Functionality #205

jhug12 opened this issue Apr 23, 2024 · 1 comment · May be fixed by #214
Labels
forecasting Forecasters and adapters help wanted Extra attention is needed
Milestone

Comments

@jhug12
Copy link

jhug12 commented Apr 23, 2024

Description:

I am proposing an enhancement for the Forecaster class in the functime library, specifically to support setting lags=0 in classes that inherit from Forecaster, such as linear_model. Currently, it is not possible to pass lags=0 as an argument to linear_model or probably other similar models that derive from the Forecaster class.

Issue:

The lack of support for lags=0 restricts users from implementing a standard multiple regression approach within the forecasting framework provided by functime. Here's an example of how one might attempt to set up a linear model forecaster without specifying lags, which implicitly requires non-zero lags:

from functime.forecasting import linear_model

forecaster_linear = linear_model(
    freq="1mo",
    lags=None
)

Desired Enhancement:

By allowing lags=0, users would be able to perform standard multiple regression analyses while benefiting from the features of functime, such as straightforward model changes and extensive cross-validation capabilities. This enhancement would make the library more versatile and applicable to a broader range of forecasting scenarios where traditional regression might be necessary.

Use Case:

This feature would be particularly useful in scenarios where the target is not known for the last n days. One Case would be the the target is the difference from current temperature to future temperature (the change) over n days. If I want to look at the future change over two days then I wouldn't have a value for the last day. Sometimes directly predicting a future value is not possible as the time series is not stationary and therefore differencing is needed.

@baggiponte
Copy link
Collaborator

Ciao @jhug12, thanks for the comment. Agree, it might just be a lags: int | None = None. As outlined in the Discord, this implies working a bit more on functime's internals (of which I am not super familiar) so I can't work on it immediately. Any help is of course welcome.

@baggiponte baggiponte added help wanted Extra attention is needed forecasting Forecasters and adapters labels Apr 27, 2024
@baggiponte baggiponte added this to the 0.11 milestone Apr 27, 2024
@jhug12 jhug12 linked a pull request May 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forecasting Forecasters and adapters help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants