functime-org / functime

Time-series machine learning at scale. Built with Polars for embarrassingly parallel feature extraction and forecasts on panel data.
https://docs.functime.ai
Apache License 2.0
971 stars 52 forks source link

Preprocessing roll fill_strategy NameError #182

Closed miroslaavi closed 3 months ago

miroslaavi commented 4 months ago

Describe the bug A tiny bug/typo in the preprocessing roll method for the fill strategy leading to NameError when using roll function. The reason is that the variable name used is X_X_rolling instead of X_rolling in the row 324.

To Reproduce

import polars as pl
from functime.preprocessing import roll
from pathlib import Path

file_path = Path(__file__).parent.parent / "data" / "commodities.parquet"

df = pl.read_parquet(source=file_path)

transformer = roll(
    window_sizes=[10, 30, 60],
    stats=["sum", "mean", "std"],
    freq="1mo",
    fill_strategy="backward",
)

df.pipe(transformer).collect()