Polars Time Series Extension
Project description
Polars Time Series Extension
Welcome to the documentation for the Polars Time Series Extension.
Documentation: https://drumtorben.github.io/polars-ts
Source Code: https://github.com/drumtorben/polars-ts
📖 Overview
The Polars Time Series Extention offers a wide range of metrics, feature extractors, and various tools for time series forecasting.
Installation
pip install polars-timeseries
How to use
The polars-ts plugin is available under the namespace pts.
See the following example where we compute the Kaboudan metric:
import polars as pl
from statsforecast import StatsForecast
from statsforecast.models import AutoETS, OptimizedTheta
import polars_ts as pts # noqa
# Create sample dataframe with columns `unique_id`, `ds`, and `y`.
df = (
pl.scan_parquet("https://datasets-nixtla.s3.amazonaws.com/m4-hourly.parquet")
.filter(pl.col("unique_id").is_in(["H1", "H2", "H3"]))
.collect()
)
# Define models
season_length = 24
models = [
OptimizedTheta(season_length=season_length, decomposition_type="additive"),
AutoETS(season_length=season_length),
]
sf = StatsForecast(models=models, freq=1, n_jobs=-1)
# Compute the Kaboudan metric in the `pts` namespace
res = df.pts.kaboudan(sf, block_size=200, backtesting_start=0.5, n_folds=10)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polars_timeseries-0.3.0.tar.gz.
File metadata
- Download URL: polars_timeseries-0.3.0.tar.gz
- Upload date:
- Size: 122.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b6986240aa416405c4e48036572a52e60972cac41711600b62b3c9a98d22f56
|
|
| MD5 |
7b99fe7658c080d1edb31f187818eb22
|
|
| BLAKE2b-256 |
e09dfa0f5522a50e4aa1e58961009b8c6475dcd3295c1358b1c4dac15f7f19f7
|
File details
Details for the file polars_timeseries-0.3.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: polars_timeseries-0.3.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf7c02a9673f730a0c7d35b25e0acf57bb10365ba4a07d6f7f4f0fea45b13db
|
|
| MD5 |
0c3e861334a7da174ab1527760299ee8
|
|
| BLAKE2b-256 |
ac92eaad8f3aecfd41bdd058bbb3f7f1e45cae8eb7bdd4eb6014b8965c82df72
|