Back to models
Forecaster

MultiplexForecaster

Categorical in XInsamplePred int insampleExogenousMultivariate

MultiplexForecaster for selecting among different models in Auto-ML pipelines.

MultiplexForecaster facilitates a framework for performing automated model selection process over different model classes. It should be used in conjunction with ForecastingGridSearchCV or similar tuners to build an Auto-ML pipeline for forecasters. MultiplexForecaster can be used with univariate and multivariate forecasters.

MultiplexForecaster is specified with a (named) list of forecasters and a selected_forecaster hyper-parameter, which is one of the forecaster names. The MultiplexForecaster then behaves precisely as the forecaster with name selected_forecaster, ignoring functionality in the other forecasters.

When used with ForecastingGridSearchCV, MultiplexForecaster provides an ability to tune across multiple estimators, i.e., to perform Auto-ML, by tuning the ,selected_forecaster, hyper-parameter. This combination will then select one of the passed forecasters via the tuning algorithm.

Quickstart

python
from sktime.forecasting.compose import MultiplexForecaster

estimator = MultiplexForecaster(forecasters: list, selected_forecaster=None)

Parameters(2)

forecasterslist of sktime forecasters, or

list of tuples (str, estimator) of sktime forecasters MultiplexForecaster can switch (“multiplex”) between these forecasters. These are “blueprint” forecasters, states do not change when fit is called.

selected_forecaster: str or None, optional, Default=None.

Name of the forecaster to be selected from the list of forecasters.

  • If str, must be one of the forecaster names. If no names are provided, must coincide with auto-generated name strings. To inspect auto-generated name strings, call get_params.

  • If None, behaves as if the first forecaster in the list is selected. Selects the forecaster as which MultiplexForecaster behaves.

Examples

>>> from sktime.forecasting.ets import AutoETS
>>> from sktime.forecasting.model_selection import ForecastingGridSearchCV
>>> from sktime.split import ExpandingWindowSplitter
>>> from sktime.forecasting.compose import MultiplexForecaster
>>> from sktime.forecasting.naive import NaiveForecaster
>>> from sktime.forecasting.theta import ThetaForecaster
>>> from sktime.forecasting.model_evaluation import evaluate
>>> from sktime.datasets import load_shampoo_sales
>>> y = load_shampoo_sales ()
>>> forecaster = MultiplexForecaster (forecasters = [
... ("ets", AutoETS ()),
... ("theta", ThetaForecaster ()),
... ("naive", NaiveForecaster ())])
>>> cv = ExpandingWindowSplitter (step_length = 12)
>>> gscv = ForecastingGridSearchCV (
... cv = cv,
... param_grid = { "selected_forecaster":["ets", "theta", "naive" ]},
... forecaster = forecaster)
>>> gscv. fit (y) ForecastingGridSearchCV(
... )