Search code examples
dataframetime-serieslstmrecurrent-neural-networktimeserieschart

Preparing time series data for building an RNN


I am preparing time series data to build an RNN model (LSTM). The data is collected from sensors installed in a mechanical plant. Consider I have data for input and output temperature of a compressor along with the time stamps.

Like this there is data for around 20 parameters recorded along with their time stamps. Problem is there is a difference in the time stamps at which data is collected.

So how do I ideally match the time stamps to create a single dataframe with all the parameters and a single time stamp?


Solution

  • Since an RNN doesn't know anything about time deltas but only about time steps, you will need to quantify / interpolate your data.

    1. Find the smallest time delta Δt in all of your series
    2. Resample all of your 20 series to Δt/2* or smaller (Nyquist-Theorem)

    * Actually you'd need to do a Fourier transform and then use twice the cutoff frequency as sampling rate. Δt/2 might IMHO be a good approximation.