import pandas as pd
import numpy as np
from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.theta import ThetaForecaster
from sktime.forecasting.model_selection import SlidingWindowSplitter
from sktime.forecasting.model_evaluation import evaluate
y = load_airline()
forecaster = ThetaForecaster(sp=12) # monthly seasonal periodicity
cv = SlidingWindowSplitter(fh=7, window_length=28, step_length=7)
evaluation_results = evaluate(forecaster=forecaster, y=y,
cv=cv, return_data=True)
print("Length train: {0}".format(len(evaluation_results.y_train[0])))
print("Length pred: {0}".format(len(evaluation_results.y_pred[0])))
Here is some working code. Based on the settings in SlidingWindowSplitter
I thought that len(evaluation_results.y_pred[0])
would be 7
evaluate
). For forecasters, the general model is that it can look at everything it has seen, so using a negative fh
will not result in proper forecasts, evaluation will be too over-optimistic.
@ilyasmoutawwakil, v.0.8.0 added framework support for multivariate forecasting, i.e., tests, input/output checks etc. In that releas version, only two concrete learners are available - the NaiveForecaster
, and ColumnEnsembleForecaster
(which allows you to apply different forecasters to different columns, or the same forecaster to all columns). These were mainly used for testing and framework development. Generally, you can find the multivariate forecasters by searching the scitype:y
tag for "multivariate"
or "both"
using all_estimators
. Currently, a number of multivariate forecasters are under development or under review: pipeline, grid search alan-turing-institute/sktime#1376 alan-turing-institute/sktime#856; vector autoregression alan-turing-institute/sktime#1083.
There's a few more forecasters that could be extended to multivariate, if you want to pick up any? alan-turing-institute/sktime#1364.