Forecaster
BATS
BATS forecaster for time series with multiple seasonality.
Quickstart
python
from sktime.forecasting.bats import BATS
estimator = BATS(use_box_cox=None, box_cox_bounds=(0, 1), use_trend=None, use_damped_trend=None, sp=None, use_arma_errors=True, show_warnings=True, n_jobs=None, multiprocessing_start_method='spawn', context=None)Parameters(10)
- use_box_cox: bool or None, optional (default=None)
- If Box-Cox transformation of original series should be applied. When None both cases shall be considered and better is selected by AIC.
- box_cox_bounds: tuple, shape=(2,), optional (default=(0, 1))
- Minimal and maximal Box-Cox parameter values.
- use_trend: bool or None, optional (default=None)
- Indicates whether to include a trend or not. When None both cases shall be considered and better is selected by AIC.
- use_damped_trend: bool or None, optional (default=None)
- Indicates whether to include a damping parameter in the trend or not. Applies only when trend is used. When None both cases shall be considered and better is selected by AIC.
- sp: Iterable or array-like of floats, optional (default=None)
- Abbreviation of “seasonal periods”. The length of each of the periods (amount of observations in each period). Accepts int and float values here. When None or empty array, non-seasonal model shall be fitted.
- use_arma_errors: bool, optional (default=True)
- When True BATS will try to improve the model by modelling residuals with ARMA. Best model will be selected by AIC. If False, ARMA residuals modeling will not be considered.
- show_warnings: bool, optional (default=True)
- If warnings should be shown or not. Also see Model.warnings variable that contains all model related warnings.
- n_jobs: int, optional (default=None)
- How many jobs to run in parallel when fitting BATS model. When not provided BATS shall try to utilize all available cpu cores.
- multiprocessing_start_method: str, optional (default=’spawn’)
How threads should be started. See also:
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
- context: abstract.ContextInterface, optional (default=None)
- For advanced users only. Provide this to override default behaviors
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.bats import BATS
>>> y = load_airline ()
>>> forecaster = BATS (
... use_box_cox = False,
... use_trend = False,
... use_damped_trend = False,
... sp = 12,
... use_arma_errors = False,
... n_jobs = 1)
>>> forecaster. fit (y) BATS(
... )
>>> y_pred = forecaster. predict (fh = [1, 2, 3 ])References
- [1 ] (1, 2) https://github.com/intive-DataScience/tbats [2 ] De Livera, A.M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series with complex seasonal patterns using exponential smoothing, Journal of the American Statistical Association, 106(496), 1513-1527. DOI: https://doi.org/10.1198/jasa.2011.tm09771 [3 ] Skorupa. Multiple Seasonalities using TBATS in Python. https://medium.com/intive-developers/forecasting-time-series-with-multiple-seasonalities-using-tbats-in-python-398a00ac0e8a [4 ] R.J. Hyndman, G. Athanasopoulos. Forecasting: Principles and Practice. https://otexts.com/fpp2/complexseasonality.html