Skip to main content

Omnicast

Automatic statistical forecasting for Python with one consistent, interval-aware API -- fit, backtest, and plot every model the same way.

Status: v0.1 alpha (renamed from auto-time-series). The API is usable, but model coverage and R parity fixtures are still growing.

Install

pip install omnicast

For local development:

uv sync --extra dev

Full docs with a worked example for every model, a real-data walkthrough, and the complete API reference are hosted at afraz496.github.io/omnicast (source under docs/). Build them locally with:

uv sync --extra docs
uv run sphinx-build -b html docs docs/_build/html

LSTMForecaster requires PyTorch, kept out of the base install:

pip install omnicast[torch]
# or, for development:
uv sync --extra dev --extra torch

Quick start

import pandas as pd
from omnicast import AutoForecaster

y = pd.Series(
    [112, 118, 121, 130, 128, 137, 143, 149, 154, 162, 169, 175],
    index=pd.period_range("2025-01", periods=12, freq="M"),
)

model = AutoForecaster(
    seasonal_period=None,
    metric="rmse",
    validation_horizon=1,
).fit(y)

forecast = model.predict(horizon=6, level=[80, 95])
print(model.leaderboard_)
print(forecast.to_frame())

Every fitted estimator exposes fitted_values_, residuals_, sigma2_, and prediction_intervals_. Statistical estimators also expose params_, parameter_confidence_intervals_ (95%), aic_, and bic_. Prediction intervals are returned on each prediction because they depend on horizon and requested coverage.

Models

Estimator Purpose Intervals
NaiveForecaster Random walk Horizon-scaled Gaussian innovation
SeasonalNaiveForecaster Seasonal random walk Cycle-scaled Gaussian innovation
MeanForecaster Historical mean Mean forecast uncertainty
DriftForecaster Random walk with drift Drift forecast uncertainty
ThetaForecaster Theta method (port of R forecast::thetaf) Random-walk innovation scaling
ETSForecaster Error/trend/seasonal state space State-space forecast uncertainty
ARIMAForecaster ARIMA/SARIMA, optional regressors State-space forecast uncertainty
AutoARIMAForecaster AICc grid-selected ARIMA State-space forecast uncertainty
LSTMForecaster Autoregressive LSTM (torch, optional) Random-walk innovation scaling
AutoForecaster Rolling-origin model selection Selected model's intervals

Evaluation

from omnicast import NaiveForecaster, backtest

folds = backtest(NaiveForecaster(), y, horizon=3, initial=6, metric="rmse")
print(folds)

Available metrics are MAE, RMSE, MAPE, and sMAPE. Backtesting uses expanding windows and never trains on future observations.

Design and scope

The package follows pandas index semantics and the familiar fit/predict estimator pattern. Learned state uses trailing underscores. Models validate input rather than silently imputing data or guessing an irregular date frequency.

This codebase is a Python implementation foundation, not a blanket claim of parity with R forecasting packages. Each future port must record its algorithm source, licensing, deviations, and numerical parity tests. See CONTRIBUTING.md.

ThetaForecaster is the first R port: a compatible pure-Python reimplementation of forecast::thetaf's classical Theta method, described in its own docstring along with the exact deviations from R's output (approximate intervals, no numerical parity fixtures yet).

LSTMForecaster is the first wrapper around a Python deep-learning module (torch, optional dependency), following the same BaseForecaster interface as the statsmodels-backed models. It is not part of AutoForecaster's default candidate list -- pass it explicitly via AutoForecaster(models=[...]) -- since it is optional-dependency and materially slower to backtest.

Contributors

  • Afraz Arif Khan (@Afraz496) -- core estimator API, statistical models, evaluation, and the Sphinx docs site.
  • Javier Martínez-Rodríguez (@JavierMtzRdz) -- the plotting and backtesting system: ForecastResult/BacktestResult and their .plot() methods, the Backtester class, every function in omnicast.plotting, AutoForecaster.plot_all(), and the real-data forecasting walkthrough notebook.

Licensed under Apache-2.0.

Download files

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

Source Distribution

omnicast-0.1.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

omnicast-0.1.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file omnicast-0.1.3.tar.gz.

File metadata

  • Download URL: omnicast-0.1.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for omnicast-0.1.3.tar.gz
Algorithm Hash digest
SHA256 be9106f38dce64ad1dc4ec040470086f0492e049b909683df14dde34376656ea
MD5 aa9a3cd56b3ddc4c4b18ed7b917fa14e
BLAKE2b-256 d6710e52557cdc3f348118918deac4486eb8949182e64000cbb335b8cb988f42

See more details on using hashes here.

File details

Details for the file omnicast-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: omnicast-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for omnicast-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1ebd58bd9fe467f02fed7296e658774d922e28f5e230eefbeb4e2deb8159d20
MD5 d14ccc674f809669979f4bc1e434d78b
BLAKE2b-256 3bc96a0f60ffcd47efe607f960b26d5dec4cb0c535454caeb23f91941923e444

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page