skillfed

tbats

BATS and TBATS for time series forecasting

tbats v1.1.3 710.6K downloads/30d#5,259 on PyPI183
Permissive license MIT License Abandoned released

What it is and what it does

TBATS implements Bayesian Automatic Time Series forecasting methods designed to handle time series with multiple seasonal patterns and trend components. It combines exponential smoothing with automatic model selection, testing various configurations (including Box-Cox transformation and ARMA error modeling) to find the best fit. The package wraps numpy, scipy, scikit-learn, and pmdarima to perform this model search and fitting.

You provide a time series and optionally specify seasonal periods; TBATS fits a model, then forecasts forward. It exposes fitted values, residuals, model parameters, and summary statistics. The package is a Python port of the R forecast package's BATS/TBATS implementation. Fitting can be computationally intensive on long series, and the documentation includes troubleshooting guidance for slow convergence and multiprocessing issues.

Use it for:

  • Forecast retail sales or demand with weekly and yearly seasonal cycles without manual model specification.
  • Analyze electricity load or utility consumption with multiple overlapping seasonal patterns.
  • Predict web traffic or system metrics that exhibit both daily and weekly seasonality.
  • Generate point forecasts and residual diagnostics for time series with complex, non-standard seasonal structures.
  • Prototype time series forecasting pipelines where automatic model selection is preferred over manual tuning.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Implements BATS and TBATS exponential smoothing methods for forecasting time series with complex seasonal patterns, built on numpy, scipy, scikit-learn, and pmdarima.

Yes, if you need BATS/TBATS forecasting and can tolerate an abandoned package. The library is stable, has low install friction, carries no known vulnerabilities, and is permissively licensed. However, the last release was 2023-04-17 with no active maintenance. Use it for prototyping or production work where you can accept no further updates; avoid it if you need ongoing support or compatibility with future dependency versions.

Install

tbats on PyPI

pip

pip install tbats

uv

uv add tbats

poetry

poetry add tbats

Installing tbats

Before you install

Low friction: pure Python wheel with four well-established scientific dependencies. However, the package is abandoned—last release was 2023-04-17 and no commits since. No active maintenance or security updates.

License in practice

MIT License (permissive): you can use, modify, and distribute this package freely with minimal restrictions, though you must retain the license notice.

Quickstart

pip install tbats

from tbats import TBATS
import numpy as np

if __name__ == '__main__':
    y = np.array([...])  # your time series
    estimator = TBATS(seasonal_periods=[14, 30.5])
    fitted_model = estimator.fit(y)
    forecast = fitted_model.forecast(steps=14)

On Windows, fitting requires wrapping code in `if __name__ == '__main__':` due to multiprocessing behavior. Fitting can be slow on long time series; consider disabling Box-Cox transformation and ARMA errors or setting n_jobs=1 if parallelization freezes.

Verify before relying

  • Whether the package remains compatible with current versions of numpy, scipy, scikit-learn, and pmdarima given the days since last release.
  • Whether the R forecast package equivalence (stated in docs) is maintained across recent updates to the R implementation.

Package facts

License MIT License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — numpy, scipy, pmdarima, scikit-learn
Maintenance abandoned — 1,215 days since the last release
Last repo commit
First released
Downloads 710,553/month — #5,259 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tbats-1.1.3-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

time series forecasting seasonalBATS TBATS exponential smoothingcomplex seasonal pattern forecastingtime series with multiple seasonalityautomated forecasting methodsseasonal decomposition forecasting
time-series-forecastingseasonal-decomposition

More Scientific/Engineering packages

Further reading