Feat/Enable no lags in Forecaster class
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=Noneoption in the context ofstrategy="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)
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 |
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.
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!