I want to build a classifier to classify time series. For each point in time series there are multiple features and a timestamp. Sometimes there is 1 second between 2 points but sometimes there could be 1 minute between timestamp. I tought to give the time compared to the previous point as a feature. Can LSTM handle that ?
Ultimately I think you are going to have to play with the data and see what works for your particular problem, but here are some thoughts
I have done something similar. My data contained regular gaps during part of the day and providing the time of day as a feature proved to be beneficial, however in this case it was likely useful in more ways than adjusting for the gaps.
If the size of the gap to the previous timestamp contains information that is useful to the network then definitely include it. If the gap is because there is data missing then that might not be very useful, but its worth a try.
If the data at each point is statistically similar regardless of the size of the gap then you may be able to simply feed them in as if there are no gaps.
If the gaps are causing the data to be non-stationary then that could make it harder for the network to learn. Which comes back to your question of can providing the gap size let the network correct for the non-stationary nature of the time series, it is possible but probably not ideal.
You might also want to try interpolation to fill in the missing gaps, and re-sampling the data to the level of granularity that is actually important for your prediction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With