Skip to content

Curator

polars_ts.agents.curator

CuratorAgent: LLM-guided data diagnostics and targeted preprocessing.

CurationReport dataclass

Results of data diagnostics.

CuratorAgent

Diagnoses data quality issues and applies targeted preprocessing.

Parameters

backend LLM backend for guided diagnostics. Defaults to rule-based heuristics. id_col Column identifying each time series. time_col Column with timestamps. target_col Column with target values. outlier_threshold Z-score threshold for outlier detection.

curate(df)

Run diagnostics on the input data and return a report.

curate_and_clean(df)

Run diagnostics then apply imputation and outlier treatment.

trim_lookback(df, lookback=None)

Trim each series to the most recent lookback observations.

Parameters

df Input DataFrame. lookback Number of most-recent observations to keep per series. If None, uses the recommended lookback from diagnostics.

_first_series_values(df)

Extract target values from the first series, dropping nulls/NaNs.

_detect_period(df)

Detect dominant period via autocorrelation peak.

_check_stationarity(df)

Check stationarity by comparing mean/variance of first vs second half.

_recommend_lookback(df)

Recommend lookback window based on regime change detection.

Uses a rolling variance ratio to detect the most recent structural break, then recommends using only data from after the break.