Search code examples
time-seriesarimasliding-windowsktime

How to use SlidingWindowSplitter in sktime


I need to fit ARIMA model from sktime package. I want to use SlidingWindowSplitter from sktime.forecasting.model_selection but I don really understand how it works. If I wanted to fit a simple ARIMA I would do this

...
model = ARIMA(order = (p, d, q)).fit(y_train)
y_pred, y_conf = model.predict(fh, return_pred_int=True)

But how that works with the SlidingWindowSplitter?


Solution

  • This should work:

    from sktime.forecasting.all import *
    from sktime.forecasting.model_evaluation import evaluate
    
    y = load_airline()
    forecaster = ARIMA()
    cv = SlidingWindowSplitter()
    out = evaluate(forecaster, cv, y)