tbats is a Python library implementing BATS and TBATS models for time series forecasting, known for handling complex seasonality and Box-Cox transformations. The current version is 1.1.3, and it receives updates primarily for bug fixes, dependency upgrades, and occasional feature enhancements, with an irregular release cadence.
pip install tbatsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize, fit, and forecast with a TBATS model. It generates a sample time series with trend and seasonality, then applies TBATS with Box-Cox transformation and ARMA errors to predict future values. `n_jobs=1` is used to prevent parallel processing in simple examples.
Upgrade to tbats version 1.1.3 or higher to resolve Box-Cox precision issues.
If unexpected behavior related to multiprocessing occurs, explicitly set `multiprocessing_start_method` in the `TBATS` constructor (e.g., `TBATS(..., multiprocessing_start_method='fork')`) to match previous behavior or to 'fork' if that is preferred and supported by your OS.
Upgrade to tbats version 1.0.6 or higher. If using older versions, ensure your application handles process pool management explicitly or restricts `n_jobs` to 1.
Upgrade to tbats version 1.0.9 or higher to ensure that `n_jobs=1` correctly disables all subprocess spawning.
Install the package using 'pip install tbats'.
Use 'from tbats import TBATS' to import the TBATS class.
Ensure 'seasonal_periods' is a list of positive numbers, e.g., 'seasonal_periods=[7, 365.25]'.
Call 'fit' with the time series data, e.g., 'fitted_model = estimator.fit(y)'.
Fit the model before forecasting, e.g., 'fitted_model = estimator.fit(y)' followed by 'y_forecasted = fitted_model.forecast(steps=14)'.