make_reduction(estimator, strategy='recursive', window_length=10, scitype='infer', transformers=None, pooling='local')[source]#

Make forecaster based on reduction to tabular or time-series regression.

During fitting, a sliding-window approach is used to first transform the time series into tabular or panel data, which is then used to fit a tabular or time-series regression estimator. During prediction, the last available data is used as input to the fitted regression estimator to generate forecasts.

estimatoran estimator instance

Either a tabular regressor from scikit-learn or a time series regressor from sktime.

strategystr, optional (default=”recursive”)

The strategy to generate forecasts. Must be one of “direct”, “recursive” or “multioutput”.

window_lengthint, optional (default=10)

Window length used in sliding window transformation.

scitypestr, optional (default=”infer”)

Must be one of “infer”, “tabular-regressor” or “time-series-regressor”. If the scitype cannot be inferred, please specify it explicitly. See scitype.

transformers: list of transformers (default = None)

A suitable list of transformers that allows for using an en-bloc approach with make_reduction. This means that instead of using the raw past observations of y across the window length, suitable features will be generated directly from the past raw observations. Currently only supports WindowSummarizer (or a list of WindowSummarizers) to generate features e.g. the mean of the past 7 observations. Currently only works for RecursiveTimeSeriesRegressionForecaster.

pooling: str {“local”, “global”}, optional

Specifies whether separate models will be fit at the level of each instance (local) of if you wish to fit a single model to all instances (“global”). Currently only works for RecursiveTimeSeriesRegressionForecaster.

estimatoran Estimator instance

A reduction forecaster



Bontempi, Gianluca & Ben Taieb, Souhaib & Le Borgne, Yann-Aël. (2013). Machine Learning Strategies for Time Series Forecasting.


>>> from sktime.forecasting.compose import make_reduction
>>> from sktime.datasets import load_airline
>>> from sklearn.ensemble import GradientBoostingRegressor
>>> y = load_airline()
>>> regressor = GradientBoostingRegressor()
>>> forecaster = make_reduction(regressor, window_length=15, strategy="recursive")
>>> y_pred = forecaster.predict(fh=[1,2,3])