Model Catalog Overview#

Source Files
  • twiga/models/baseline/ - no-training baselines

  • twiga/models/ml/ - tree-based and linear models

  • twiga/models/nn/ - neural network models

  • twiga/models/nn/rnn_model.py - RNNModel / RNNConfig

  • twiga/models/nn/prob/rnn_parametric.py - RNN parametric distribution wrappers

  • twiga/models/nn/prob/rnn_qr.py - RNNQR / RNNFPQR

  • twiga/forecaster/registry.py

A single TwigaForecaster trains, tunes, evaluates and backtests any model in the catalog through an identical API. Switching from a gradient-boosted tree to a neural network means changing one config object, not rewriting training code. The entire workflow — feature engineering, training, hyperparameter optimisation, backtesting and calibration — is unified in one interface with no library boundaries to cross.

Twiga provides forecasting models across three domains: baseline (parameter-free reference models), ml (gradient-boosted trees, random forests, linear, and NGBoost), and nn (neural networks). All models share a common interface and are loaded dynamically through the model registry.

The table below lists the base model configurations. In addition, every neural architecture (MLPF, MLPGAM, MLPGAF, NHITS) has dedicated probabilistic config classes for each distribution family (Normal, Laplace, LogNormal, Gamma, Beta, StudentT, QR, FPQR, CRC) - see Neural Network Models for the full matrix.

Available Models#

Baseline Domain#

Model

Name

Domain

Type

Config Class

Description

Naive

naive

baseline

Point

NAIVEConfig

Per-window last value, training mean, or zero

Seasonal Naive

seasonal_naive

baseline

Point

SEASONALNAIVEConfig

Repeats value from m steps ago (daily/weekly)

Window Average

window_average

baseline

Point

WINDOWAVERAGEConfig

Local mean over the last w steps

Drift

drift

baseline

Point

DRIFTConfig

Linear extrapolation of per-window trend

Context Parrot

context_parrot

baseline

Point

CONTEXTPARROTConfig

Repeats the last observed context window as the forecast

ML Domain#

Model

Name

Domain

Type

Config Class

Description

CatBoost

catboost

ml

Point

CATBOOSTConfig

Gradient boosting with ordered boosting

XGBoost

xgboost

ml

Point

XGBOOSTConfig

Gradient boosting with regularization

LightGBM

lightgbm

ml

Point

LIGHTGBMConfig

Histogram-based gradient boosting

Random Forest

randomforest

ml

Point

RANDOMFORESTConfig

Bagged decision trees, native multi-output

Linear Regression

lineareg

ml

Point

LINEAREGConfig

OLS linear model

Gaussian CatBoost

gausscatboost

ml

Probabilistic

GAUSSCATBOOSTConfig

CatBoost with Gaussian output (mean + sigma)

NGBoost Normal

ngboostnormal

ml

Probabilistic

NGBOOSTNORMALConfig

Natural gradient boosting, Gaussian distribution

NGBoost LogNormal

ngboostlognormal

ml

Probabilistic

NGBOOSTLOGNORMALConfig

Natural gradient boosting, LogNormal (positive targets)

NGBoost Exponential

ngboostexponential

ml

Probabilistic

NGBOOSTEXPONENTIALConfig

Natural gradient boosting, Exponential distribution

QR CatBoost

qrcatboost

ml

Quantile

QRCATBOOSTConfig

CatBoost with multi-quantile loss

QR XGBoost

qrxgboost

ml

Quantile

QRXGBOOSTConfig

XGBoost with quantile regression

QR LightGBM

qrlightgbm

ml

Quantile

QRLIGHTGBMConfig

LightGBM with quantile regression

QR Random Forest

qrrandomforest

ml

Quantile

QRRANDOMFORESTConfig

Single-forest quantile regression, any quantile at inference

NN Domain#

Each architecture ships as a point base model plus a full suite of probabilistic variants. All share the nn domain and are loaded via the same registry.

Base Architectures#

Model

Name

Config Class

Description

MLPF

mlpf

MLPFConfig

MLP forecaster with attention-based feature combination

MLPGAM

mlpgam

MLPGAMConfig

MLP with Generalized Additive Model structure

MLPGAF

mlpgaf

MLPGAFConfig

MLP with Gated Additive Features

N-HiTS

nhits

NHITSConfig

Neural Hierarchical Interpolation for Time Series

RNN

rnn

RNNConfig

GRU/LSTM recurrent network with bidirectional support

MLPF Probabilistic Variants#

Name

Type

Config Class

mlpfnormal

Parametric — Normal

MLPFNormalConfig

mlpflaplace

Parametric — Laplace

MLPFLaplaceConfig

mlpflognormal

Parametric — LogNormal

MLPFLogNormalConfig

mlpfgamma

Parametric — Gamma

MLPFGammaConfig

mlpfbeta

Parametric — Beta

MLPFBetaConfig

mlpfqr

Quantile Regression

MLPFQRConfig

mlpffpqr

Full Parameterised QR

MLPFFPQRConfig

mlpfcrc

Conformal Residual Coverage

MLPFCRCConfig

MLPGAM Probabilistic Variants#

Name

Type

Config Class

mlpgamnormal

Parametric — Normal

MLPGAMNormalConfig

mlpgamlaplace

Parametric — Laplace

MLPGAMLaplaceConfig

mlpgamlognormal

Parametric — LogNormal

MLPGAMLogNormalConfig

mlpgamgamma

Parametric — Gamma

MLPGAMGammaConfig

mlpgambeta

Parametric — Beta

MLPGAMBetaConfig

mlpgamstudentt

Parametric — Student-t

MLPGAMStudentTConfig

mlpgamqr

Quantile Regression

MLPGAMQRConfig

mlpgamfpqr

Full Parameterised QR

MLPGAMFPQRConfig

mlpgamcrc

Conformal Residual Coverage

MLPGAMCRCConfig

MLPGAF Probabilistic Variants#

Name

Type

Config Class

mlpgafnormal

Parametric — Normal

MLPGAFNormalConfig

mlpgaflaplace

Parametric — Laplace

MLPGAFLaplaceConfig

mlpgaflognormal

Parametric — LogNormal

MLPGAFLogNormalConfig

mlpgafgamma

Parametric — Gamma

MLPGAFGammaConfig

mlpgafbeta

Parametric — Beta

MLPGAFBetaConfig

mlpgafstudentt

Parametric — Student-t

MLPGAFStudentTConfig

mlpgafqr

Quantile Regression

MLPGAFQRConfig

mlpgaffpqr

Full Parameterised QR

MLPGAFFPQRConfig

mlpgafcrc

Conformal Residual Coverage

MLPGAFCRCConfig

N-HiTS Probabilistic Variants#

Name

Type

Config Class

nhitsnormal

Parametric — Normal

NHITSNormalConfig

nhitslaplace

Parametric — Laplace

NHITSLaplaceConfig

nhitslognormal

Parametric — LogNormal

NHITSLogNormalConfig

nhitsgamma

Parametric — Gamma

NHITSGammaConfig

nhitsbeta

Parametric — Beta

NHITSBetaConfig

nhitsstudentt

Parametric — Student-t

NHITSStudentTConfig

nhitsqr

Quantile Regression

NHITSQRConfig

nhitsfpqr

Full Parameterised QR

NHITSFPQRConfig

nhitscrc

Conformal Residual Coverage

NHITSCRCConfig

RNN Probabilistic Variants#

Name

Type

Config Class

rnnnormal

Parametric — Normal

RNNNormalConfig

rnnlaplace

Parametric — Laplace

RNNLaplaceConfig

rnnlognormal

Parametric — LogNormal

RNNLogNormalConfig

rnngamma

Parametric — Gamma

RNNGammaConfig

rnnbeta

Parametric — Beta

RNNBetaConfig

rnnstudentt

Parametric — Student-t

RNNStudentTConfig

rnnqr

Quantile Regression

RNNQRConfig

rnnfpqr

Full Parameterised QR

RNNFPQRConfig

Model Class Hierarchy#

        classDiagram
    class BaseRegressor {
        <<ML / Baseline>>
        +fit(X, y)
        +predict(x)
        +forecast(x)
    }

    class BaseQuantileRegressor {
        <<ML Quantile>>
        +quantiles: list
        +fit(X, y)
        +predict(X, sigma)
    }

    class BaseNGBoostRegressor {
        <<ML Probabilistic>>
        +fit(X, y)
        +predict(X)
    }

    class BaseNeuralForecast {
        <<NN Base>>
        +fit(X_train, y_train, X_val, y_val)
        +forecast(features)
        +update(trial)
    }

    class MLPFVariants["MLPF Variants (×8)"] {
        mlpfnormal · mlpflaplace · mlpflognormal
        mlpfgamma · mlpfbeta
        mlpfqr · mlpffpqr · mlpfcrc
    }

    class MLPGAMVariants["MLPGAM Variants (×9)"] {
        mlpgamnormal · mlpgamlaplace · mlpgamlognormal
        mlpgamgamma · mlpgambeta · mlpgamstudentt
        mlpgamqr · mlpgamfpqr · mlpgamcrc
    }

    class MLPGAFVariants["MLPGAF Variants (×9)"] {
        mlpgafnormal · mlpgaflaplace · mlpgaflognormal
        mlpgafgamma · mlpgafbeta · mlpgafstudentt
        mlpgafqr · mlpgaffpqr · mlpgafcrc
    }

    class NHITSVariants["N-HiTS Variants (×9)"] {
        nhitsnormal · nhitslaplace · nhitslognormal
        nhitsgamma · nhitsbeta · nhitsstudentt
        nhitsqr · nhitsfpqr · nhitscrc
    }

    class RNNVariants["RNN Variants (×8)"] {
        rnnnormal · rnnlaplace · rnnlognormal
        rnngamma · rnnbeta · rnnstudentt
        rnnqr · rnnfpqr
    }

    BaseRegressor <|-- NAIVEModel
    BaseRegressor <|-- SEASONALNAIVEModel
    BaseRegressor <|-- WINDOWAVERAGEModel
    BaseRegressor <|-- DRIFTModel
    BaseRegressor <|-- CONTEXTPARROTModel
    BaseRegressor <|-- CATBOOSTModel
    BaseRegressor <|-- XGBOOSTModel
    BaseRegressor <|-- LIGHTGBMModel
    BaseRegressor <|-- RANDOMFORESTModel
    BaseRegressor <|-- LINEAREGModel
    BaseRegressor <|-- GAUSSCATBOOSTModel
    BaseRegressor <|-- QRRANDOMFORESTModel
    BaseRegressor <|-- BaseQuantileRegressor
    BaseQuantileRegressor <|-- QRCATBOOSTModel
    BaseQuantileRegressor <|-- QRXGBOOSTModel
    BaseQuantileRegressor <|-- QRLIGHTGBMModel
    BaseNGBoostRegressor <|-- NGBOOSTNORMALModel
    BaseNGBoostRegressor <|-- NGBOOSTLOGNORMALModel
    BaseNGBoostRegressor <|-- NGBOOSTEXPONENTIALModel

    BaseNeuralForecast <|-- MLPFModel
    BaseNeuralForecast <|-- MLPGAMModel
    BaseNeuralForecast <|-- MLPGAFModel
    BaseNeuralForecast <|-- NHITSModel
    BaseNeuralForecast <|-- RNNModel
    MLPFModel <|-- MLPFVariants
    MLPGAMModel <|-- MLPGAMVariants
    MLPGAFModel <|-- MLPGAFVariants
    NHITSModel <|-- NHITSVariants
    RNNModel <|-- RNNVariants
    

Choosing a Model#

Use Case

Recommended Models

Why

Establish performance floor

naive, seasonal_naive, drift, context_parrot

Zero-training reference; compute skill scores against ML/NN

Quick ML baseline

lineareg, randomforest

Fast training, easy to interpret

Tabular data, many features

catboost, lightgbm, xgboost

Strong with heterogeneous features

GPU acceleration needed

catboost (GPU), xgboost (CUDA), mlpf, nhits, rnn

Native GPU support

Parametric uncertainty — symmetric

gausscatboost, ngboostnormal, mlpfnormal, nhitsnormal, rnnnormal

Gaussian output with mean + sigma

Parametric uncertainty — heavy tails

mlpgamstudentt, mlpgafstudentt, nhitsstudentt, rnnstudentt

Student-t handles heavier-tailed residuals

Parametric uncertainty — positive targets

ngboostlognormal, mlpflognormal, mlpgamgamma, rnngamma

LogNormal / Gamma for count or power data

Distribution-free quantiles — ML

qrcatboost, qrxgboost, qrlightgbm, qrrandomforest

Pinball loss, any quantile at inference

Distribution-free quantiles — NN

mlpfqr, mlpgamqr, mlpgafqr, nhitsqr, rnnqr

Simultaneous multi-quantile output

Learned quantile levels

mlpffpqr, mlpgamfpqr, mlpgaffpqr, nhitsfpqr, rnnfpqr

FPQR adapts quantile levels during training

Post-hoc coverage guarantee

mlpfcrc, mlpgamcrc, mlpgafcrc, nhitscrc

Conformal residual coverage wraps any NN

Sequential / recurrent patterns

rnn

GRU/LSTM captures step-by-step temporal dependencies

Complex temporal patterns

nhits, mlpf

Deep learning captures nonlinearities

Interpretable forecasts

mlpgam, mlpgaf

Additive structure provides feature insights

Small datasets

lineareg, catboost, randomforest

Less prone to overfitting

Model Registry#

Models are loaded dynamically via the registry in twiga/forecaster/registry.py. The naming convention is:

  • Module: twiga.models.{domain}.{name}_model

  • Model class: {NAME}Model (uppercase)

  • Config class: {NAME}Config (uppercase)

For example, get_model("catboost", "ml") loads from twiga.models.ml.catboost_model and returns (CATBOOSTModel, CATBOOSTConfig).

See Creating Custom Models for how to add new models to the registry.