# How to use LSTM for time series data?

I've an ECG data spread over time. The duration for each data is around 3 minutes (approx 180 seconds).

Each second around 200 recordings were taken. So total length for each sample is approx 36000.

Now how to use this data for lstm. My purpose is to make an encoder-decoder network to encode this data into small size. I'm planning to use reconstruction error for loss function.

If you are going to use the ECG time series as the input for the LSTM-network you will need to reshape your data

data = data.reshape(signal length,time step pr sample, ECG channel)


So if your data is 36000 samples long and you only use 1 channel you will do like this:

data = data.reshape(36000,1,1)


Then you can make a simple LSTM model like this:

model = Sequential()