Skip to content

taf-society/durbyn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

durbyn logo

durbyn

Python wrapper for Durbyn.jl time series forecasting

CI Documentation License: MIT PyPI Python


durbyn brings the power of the Julia Durbyn.jl time series forecasting package to Python. It provides a familiar, scikit-learn-style API with .fit() / .forecast() methods, numpy arrays, and optional pandas integration — while delegating all computation to Julia for performance.

Durbyn — Kurdish for "binoculars" (Dur, far + Byn, to see), embodies foresight through science.

Features

  • 21 forecasting models — Exponential Smoothing (SES, Holt, Holt-Winters, ETS), ARIMA, AutoARIMA, BATS, TBATS, Theta, Diffusion, ARAR, ARARMA, Croston variants, and Naive baselines
  • Scikit-learn-style API.fit(y, m=12).forecast(h=12, level=[80, 95])
  • Prediction intervals — configurable confidence levels
  • Model comparisoncompare() evaluates multiple models on train/test splits
  • Panel dataPanelForecaster fits per group in a DataFrame
  • Pure Python metrics — ME, RMSE, MAE, MPE, MAPE, MASE, ACF1
  • Pandas integration.to_dataframe() on all results
  • Matplotlib plotting.plot() with history and prediction intervals

Installation

pip install durbyn

Optional dependencies:

pip install durbyn[all]     # pandas + matplotlib
pip install durbyn[pandas]  # DataFrame support
pip install durbyn[plot]    # plotting

Note: Julia must be installed on your system. The juliacall package manages the Julia runtime automatically.

Quick Start

from durbyn import AutoARIMA

# Fit an automatic ARIMA model
model = AutoARIMA().fit(y, m=12)

# Generate forecasts with prediction intervals
fc = model.forecast(h=12, level=[80, 95])

print(fc.mean)            # numpy array of point forecasts
print(fc.to_dataframe())  # pandas DataFrame
fc.plot()                 # matplotlib figure

Models

Category Classes
Exponential Smoothing SES, Holt, HoltWinters, ETS, Croston
ARIMA ARIMA, AutoARIMA
Naive Naive, SeasonalNaive, RandomWalk, MeanForecast
BATS BATS, TBATS
Theta Theta, AutoTheta
Diffusion Diffusion
ARAR ARAR, ARARMA, AutoARARMA
Intermittent Demand CrostonClassic, CrostonSBA, CrostonSBJ

All models follow the same interface:

model = SomeModel(**params)
model.fit(y, m=seasonal_period)
fc = model.forecast(h=steps_ahead, level=[80, 95])

fc.mean              # point forecasts
fc.lower[80]         # lower bound at 80%
fc.upper[95]         # upper bound at 95%
model.fitted_values  # in-sample fitted values
model.residuals      # in-sample residuals
model.summary        # model summary string

Model Comparison

from durbyn import SES, Holt, HoltWinters, AutoARIMA, compare

result = compare(
    models={
        "SES": SES(),
        "Holt": Holt(damped=True),
        "HW": HoltWinters(seasonal="multiplicative"),
        "AutoARIMA": AutoARIMA(),
    },
    y_train=y_train,
    y_test=y_test,
    m=12,
)

print(result.to_dataframe())  # accuracy metrics per model
result.plot()                  # overlay all forecasts

Panel Data

import pandas as pd
from durbyn import AutoARIMA, PanelForecaster

pf = PanelForecaster(model=AutoARIMA(), groupby="store")
pf.fit(data, y_col="sales", m=12, date_col="date")
result = pf.forecast(h=12, level=[80, 95])
print(result.to_dataframe())

Documentation

Full documentation: taf-society.github.io/durbyn

About TAFS

TAFS (Time Series Analysis and Forecasting Society) is a non-profit association in Vienna, Austria, connecting academics, experts, practitioners, and students focused on time-series, forecasting, and decision science. Learn more at taf-society.org.

License

MIT License. See LICENSE for details.

About

Python wrapper for Durbyn.jl — high-performance time series forecasting with a scikit-learn-style API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors