Consider a number of timeseries. Here we have 3, just to make it dead simple. Note that they're all different lengths.

enter image description here

The very first thing I do is splitting by the original sample dimension:

enter image description here

Then, to deal with the uneven lengths, I chop it into smaller windows: enter image description here

Where each window is a slice of w/h, and some spacing s to control for the amount of overlap (bonus question: is overlap a no-no?).

Then I simply take all my windows, shuffle them and voila, a dataset for any machine learning algorithm: enter image description here

Now, my question is simply: is this correct? scikit-learn prefers to do splits along the time-axis https://scikit-learn.org/stable/modules/cross_validation.html#time-series-split, which to me is

a) a bit strange, considering that each split is a different shape (unless the idea is to train a new model for each w/h shape combination? If so, cross-validation is a slightly misleading name) and

b) seems to assume that all future samples are simply continuations of pre-existing timeseries.

enter image description here

Am I correct in my assumptions, both about my own and scikit-learn's way of working?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.