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 ts. 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 `ts` namespace
res = df.ts.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.2.0.tar.gz (54.1 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.2.0-cp312-abi3-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file polars_timeseries-0.2.0.tar.gz.

File metadata

  • Download URL: polars_timeseries-0.2.0.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for polars_timeseries-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab6cd0db8adc1ae90f8968699df281413ddeb374b94a4f8c4f8398c2b773dd55
MD5 6816fd48ea58c8539815b1ffc24b47b2
BLAKE2b-256 7ad070c92642d69270be5d2a8c38da1e7afea0cf3ea41bb2597cddee793d88f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_timeseries-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a6aee1bdb364c806931f4be7d0610c0f57ea00df02226c41eed2509a80689a52
MD5 c850a79d67604cabaf8480032cd7602f
BLAKE2b-256 3e0437453ba02b29dc06ff583c375838b8503ff6389313a49f4fa9bc38d88f39

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