Skip to content

Huggingface

polars_ts.adapters.huggingface

Adapter for HuggingFace time series models (Chronos, TimesFM, etc.).

to_hf_dataset(df, target_col='y', id_col='unique_id', time_col='ds')

Convert a polars-ts DataFrame to a HuggingFace Dataset.

Creates a datasets.Dataset with one row per time series, where the target values are stored as a list (the format expected by HuggingFace time series models like Chronos).

Requires the datasets package.

Returns

datasets.Dataset HuggingFace Dataset with columns ["id", "target", "start"].