Skip to content

Global model

polars_ts.streaming.global_model

Streaming global forecaster with incremental model updates.

StreamingGlobalForecaster

Global forecaster supporting incremental updates via partial_fit.

Uses a scikit-learn estimator that supports partial_fit() (e.g., SGDRegressor) for online model updates as new data arrives.

Parameters

estimator Scikit-learn-compatible estimator with fit and partial_fit. lags Lag offsets for feature engineering. window_size Maximum observations to retain per series for feature context. id_col, time_col, target_col Column name overrides.

fit(df)

Batch fit: initialize window buffers and train model.

partial_fit(df)

Incrementally update model with new observations.

predict(h)

Generate h-step forecasts using recursive prediction.

_build_features_from_windows()

Build lag features from all series windows.

_make_lag_features(values)

Create lag feature vector from the tail of a values list.