Forecaster
EnbPIForecaster
Ensemble Bootstrap Prediction Interval Forecaster.
Quickstart
python
from sktime.forecasting.enbpi import EnbPIForecaster
estimator = EnbPIForecaster(forecaster=None, bootstrap_transformer=None, random_state=None, aggregation_function='mean')Parameters(4)
- forecasterestimator
- The base forecaster to fit to each bootstrap sample.
- bootstrap_transformertsbootstrap.BootstrapTransformer
The transformer to fit to the target series to generate bootstrap samples. This transformer must be able to return the indices of the original time series as an additional column. I.e., the
bootstrap_transformermust have thecapability:bootstrap_indicestag, and its parameterreturn_indicesmust be set to True.- random_stateint, RandomState instance or None, default=None
- Random state for reproducibility.
- aggregation_functionstr, default=”mean”
- The aggregation function to use for combining the predictions of the fitted forecasters. Either “mean” or “median”.
Examples
>>> import numpy as np
>>> from tsbootstrap import MovingBlockBootstrap
>>> from sktime.forecasting.enbpi import EnbPIForecaster
>>> from sktime.forecasting.naive import NaiveForecaster
>>> from sktime.datasets import load_airline
>>> from sktime.transformations.difference import Differencer
>>> from sktime.transformations.detrend import Deseasonalizer
>>> from sktime.forecasting.base import ForecastingHorizon
>>> y = load_airline ()
>>> forecaster = Differencer (lags = [1 ]) * Deseasonalizer (sp = 12) * EnbPIForecaster (
... forecaster = NaiveForecaster (sp = 12),
... bootstrap_transformer = MovingBlockBootstrap (n_bootstraps = 10))
>>> fh = ForecastingHorizon (np. arange (1, 13))
>>> forecaster. fit (y, fh = fh) TransformedTargetForecaster(
... )
>>> res = forecaster. predict ()
>>> res_int = forecaster. predict_interval (coverage = [0.5 ])References
- [1 ] Chen Xu & Yao Xie (2021). Conformal Prediction Interval for Dynamic Time-Series... [R09383241d85a-2] Valeriy Manokhin, PhD, MBA, CQF. Demystifying EnbPI: Mastering Conformal Prediction Forecasting