Imagine you are training a model to predict some future value, like in time series forecasting. Say we are not able to train on all the data because there is too much (too computationally demanding). The solution is to use a sliding window so that the model is always being trained on the most recent subset of data, say 2 months.

But if we use a sliding window there is a chance we are missing out on some seasonality in the data.

How can one account for possible seasonality while only training a model on a subset of data? Or is this actually already account for, since the window would slide with the seasonality anyway?


1 Answer 1


Sliding window is one possible solution to this problem. A key parameter here is to select the size of the window. I would guess that the size should be at least two times the seasonal period, the retrained model will be able to capture seasonality. You could decide the size of the window based on empirical results. The seasonal period could be decided with a preliminary analysis and/ or domain knowledge.

Another approach would be to estimate an adaptive model and allow model parameters to slightly change when a new observation becomes available. An example would be recursive least squares with forgetting factor.

  • $\begingroup$ The model would indeed be adaptive, since it is being retrained each time the window slides. I wonder if this precludes the need to know the seasonality, since the model would be taking any change in new data into account. $\endgroup$
    – Cybernetic
    Commented Sep 24, 2020 at 12:13
  • $\begingroup$ Overall the procedure would be adaptive, but each model is trained offline, not adaptively. This could result in some model parameters changing abruptly for successive time steps and result in noisy estimates. $\endgroup$ Commented Sep 24, 2020 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.