1
$\begingroup$

I would like to know if it is impossible to use K-fold cross-validation for time series of data. It has been discussed that it is not reasonable to predict past from future, but I think this does not make sense since time series data might be repeated in the future. Suppose a past fold is going to be repeated in the future exactly with the same pattern. Therefore, in that case, the fold that we are considering as past data will be part of the future!

$\endgroup$

1 Answer 1

1
$\begingroup$

K-fold cross-validation is not appropriate for time series. It's perfectly reasonable to use the past to predict the future; the problem is that cross-validation will normally try to predict the past from the future, which is silly and not representative of how it would be used in real life.

Instead, the appropriate way is to use temporally consistent cross-validation. In this method, we randomly pick a date; all data before that date goes into the training set, and all data after that date goes into the validation set.

If you discover that certain patterns repeat, then yes, a good model will be able to take advantage of that to predict the future accurately. If so, great! That will show up positively during both cross-validation and during real-world deployment, so cross-validation is indeed accurately estimating how well the scheme will perform if deployed in practice, which is what we want.

$\endgroup$

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.