Python wrapper for Durbyn.jl time series forecasting
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.
- 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 comparison —
compare()evaluates multiple models on train/test splits - Panel data —
PanelForecasterfits 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
pip install durbynOptional dependencies:
pip install durbyn[all] # pandas + matplotlib
pip install durbyn[pandas] # DataFrame support
pip install durbyn[plot] # plottingNote: Julia must be installed on your system. The
juliacallpackage manages the Julia runtime automatically.
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| 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 stringfrom 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 forecastsimport 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())Full documentation: taf-society.github.io/durbyn
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.
MIT License. See LICENSE for details.
