functime icon indicating copy to clipboard operation
functime copied to clipboard

Feat/Enable no lags in Forecaster class

Open jhug12 opened this issue 1 year ago • 3 comments

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)

jhug12 avatar May 08 '24 14:05 jhug12

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

vercel[bot] avatar May 08 '24 14:05 vercel[bot]

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.

baggiponte avatar May 18 '24 18:05 baggiponte

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!

jhug12 avatar May 22 '24 11:05 jhug12