1
$\begingroup$

I am not sure how the "Sliding window" method work.

Let's assume I have a dataset of number of logins by hour.

a) A window of 24hours to predict the next 24h?

b) A window of 24h to predict the next 1h?

Thank you

$\endgroup$

1 Answer 1

1
$\begingroup$

Well a sliding window of 24 would take 24 samples at a time moving down the index with one step. For example, if you had 24 hours in a window of length 24, you’ll have 0-23 samples in your window at iteration 0. At iteration 1, your window will move by your step size(1) down so it’ll cover 1-24.

$\endgroup$
3
  • $\begingroup$ Does that mean that 24 samples are used to forecast only 1 sample? $\endgroup$
    – Aizzaac
    Commented Jun 20, 2019 at 13:37
  • $\begingroup$ With respects to predictions, it can go either way depending on your batch size and step size. For purposes of time series, it’s usually one step predictions and not next 24(at that point you’d just make your frequency larger 48 hour intervals). If you’re doing predictions with a network of some sort( I’m assuming LSTM?) you’ll have to do a little bit of reshaping. But typically, yes, 1 step. $\endgroup$ Commented Jun 20, 2019 at 14:04
  • $\begingroup$ You find some illustrative graphics and exlanation on time series cross-validation (sliding windows) on Rob Hyndmans blog, see here $\endgroup$ Commented Jun 20, 2019 at 17:30

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.