Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_timeseries-0.3.0.tar.gz (122.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polars_timeseries-0.3.0-cp312-abi3-macosx_11_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

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

Hashes for polars_timeseries-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4b6986240aa416405c4e48036572a52e60972cac41711600b62b3c9a98d22f56
MD5 7b99fe7658c080d1edb31f187818eb22
BLAKE2b-256 e09dfa0f5522a50e4aa1e58961009b8c6475dcd3295c1358b1c4dac15f7f19f7

See more details on using hashes here.

File details

Details for the file polars_timeseries-0.3.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_timeseries-0.3.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ccf7c02a9673f730a0c7d35b25e0acf57bb10365ba4a07d6f7f4f0fea45b13db
MD5 0c3e861334a7da174ab1527760299ee8
BLAKE2b-256 ac92eaad8f3aecfd41bdd058bbb3f7f1e45cae8eb7bdd4eb6014b8965c82df72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page