1
$\begingroup$

In Python you can use TimeSeriessplit() to split a time series properly for training but you can also do the same(?) in Keras by TimeseriesGenerator. Which one is recommendable? And/or what are certain differences?

$\endgroup$
2
$\begingroup$

Assuming they can both do what you want them for (can perform the correct splits for your needs), I would recommend simply using the one that fits best with your pipeline. E.g. the data is being fed straight into a Keras model, just do as much as possible in Keras -> use the TimeseriesGenerator. Otherwise, stick to Sci-kit Learn.

The both generate the splits, meaning they only actually create each split as you loop through the data. This saves memory.

Looking at the source code of the Keras variant, it doesn't seem to support running on the GPU if you combine e.g. with your Tensorflow graph - meaning there really isn't a big difference between the two, just the APIs/functionality.

$\endgroup$

Your Answer

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

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