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.1.tar.gz (213.7 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.1-cp312-abi3-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for polars_timeseries-0.3.1.tar.gz
Algorithm Hash digest
SHA256 54812a7e1c5d20d4b153fc2e976bdb9325c0897cf31ed3e00beeb4b561545ede
MD5 791e42a0e6d5e9a469b49ba89e6bafe5
BLAKE2b-256 d92b67af0f74eed5caf2b0a6f706837d2cd1e45e1961380d901c05c7ccd117fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_timeseries-0.3.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 835dddbd15e68941a23557de414ec5695f9f4ae30646fa8c997e24e12704e2bb
MD5 b623a6f0d445162bb663d768af44f702
BLAKE2b-256 1fafc924b05b16b461aadb74776923af7edaba042e6e4272a34a549c9356edfc

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