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

Feat/Enable no lags in Forecaster class #214

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jhug12
Copy link

@jhug12 jhug12 commented May 8, 2024

Reference Issues/PRs

Fixes #205

Summary

This pull request introduces the initial implementation of the lags=None feature, which currently only functions with the strategy="recursive" setting. If this approach meets the requirements for solving the referenced issue, I recommend expanding this functionality in a uniform manner throughout the codebase.

Proposed Changes

  • Implement the lags=None option in the context of strategy="recursive".
  • Outline a plan for extending this feature across other relevant parts of the codebase.

Code to Test the Implementation

import polars as pl
from functime.forecasting import linear_model
from functime.seasonality import add_calendar_effects

y = pl.read_parquet("https://github.com/functime-org/functime/raw/main/data/commodities.parquet")
entity_col, time_col = y.columns[:2]
X = (
    y.select([entity_col, time_col])
    .pipe(add_calendar_effects(["month"]))
    .collect()
)

forecaster_linear = linear_model(
    freq="1mo",
    lags=None
)
y_preds, y_resids = forecaster_linear.backtest(y=y, X=X, test_size=12, step_size=12, n_splits=5)

Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
functime-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 8:38am

jhug12 and others added 2 commits May 8, 2024 18:30
@baggiponte
Copy link
Collaborator

Ciao @jhug12 and sorry for missing out - I was swamped with work. I will review this hopefully this week. In the meantime: thank you very much for your work. I am merging a couple of other things, so I will ping you later to rebase this branch against main.

functime/backtesting.py Outdated Show resolved Hide resolved
@jhug12
Copy link
Author

jhug12 commented May 22, 2024

Hi @baggiponte! No worries at all, I totally understand being busy with work. Thanks so much for handling the merging, and just give me a heads-up whenever you need me to rebase the branch. I appreciate your efforts!

@baggiponte baggiponte added the forecasting Forecasters and adapters label Jun 9, 2024
@baggiponte baggiponte added this to the 0.10 milestone Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forecasting Forecasters and adapters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow lags=0 in linear_model Class for Standard Regression Functionality
2 participants