Forecaster
EnsembleForecaster
Ensemble of forecasters.
Quickstart
python
from sktime.forecasting.compose import EnsembleForecaster
estimator = EnsembleForecaster(forecasters, n_jobs=None, aggfunc='mean', weights=None)Parameters(4)
- forecasterslist of estimator, (str, estimator), or (str, estimator, count) tuples
Estimators to apply to the input series.
(str, estimator) tuples: the string is a name for the estimator.
estimator without string will be assigned unique name based on class name
(str, estimator, count) tuples: the estimator will be replicated count times.
- n_jobsint or None, optional, default=None
- The number of jobs to run in parallel for fit. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors.
- aggfuncstr, {‘mean’, ‘median’, ‘min’, ‘max’}, default=’mean’
- The function to aggregate prediction from individual forecasters.
- weightslist of floats
- Weights to apply in aggregation.
Examples
>>> from sktime.forecasting.compose import EnsembleForecaster
>>> from sktime.forecasting.naive import NaiveForecaster
>>> from sktime.forecasting.trend import PolynomialTrendForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> forecasters = [
... ("trend", PolynomialTrendForecaster ()),
... ("naive", NaiveForecaster ()),
... ]
>>> forecaster = EnsembleForecaster (forecasters = forecasters, weights = [4, 10 ])
>>> forecaster. fit (y = y, fh = [1, 2, 3 ]) EnsembleForecaster(
... )
>>> y_pred = forecaster. predict ()