Twiga Forecast#

Twiga Forecast

Point & probabilistic time series forecasting -
one interface, every model.

Python 3.12 Apache 2.0
Install pip install twiga

Most forecasting libraries force a choice between ML and deep learning, between point forecasts and probabilistic ones, or between flexibility and production readiness. Twiga removes that trade-off.

One interface, every model

A single TwigaForecaster trains, tunes, evaluates and backtests any model through an identical API. Switching from a gradient-boosted tree to a neural network means changing one config object, not rewriting code.

Explore models

Composable probabilistic architecture

Any backbone pairs with any distribution head without modification, giving a full matrix of probabilistic models from a small set of reusable building blocks. Adding a new architecture or head is a focused, isolated change.

Explore probabilistic

Calibrated uncertainty on any model

Conformal prediction wraps any trained model, including plain point-forecast models like LightGBM, with finite-sample intervals that carry a formal coverage guarantee. One call after training, no retraining and no distributional assumptions required.

Explore conformal prediction

Experiment-ready by default

Every component is configured through validated Pydantic dataclasses that are serialisable and directly wired to Optuna search spaces. Hyperparameter tuning, time-based backtesting and checkpoint-based resume are first-class features.

Explore handbook

Statistical analysis and feature intelligence

Eight feature-target association measures are computed in a single call and fused with Borda-count rank aggregation and random-forest importance to produce a robust ranked feature list. Stationarity tests, entropy measures and residual diagnostics are included, all returning tidy DataFrames.

Explore feature analysis

Production MLOps out of the box

An optional five-module stack covers experiment tracking, versioned checkpoints, drift monitoring, a production REST API and automated retraining as a schedulable workflow. All modules install together and operate without external infrastructure.

Explore MLOps