I've been reading for a while about training LSTM
models using tf.keras
, where i did use the same framework for regression problems using simple feedforward NN
architectures and i highly understand how should i prepare the input data for such models, however when it comes for training LSTM
, i feel so confused about the shape of the input.
There is a lot to take care about: time steps
, number of samples
, batch size
, number of units
, etc. In addition to many parameters for the LSTM
keras
layer that aren't clear for me yet as what is shown in the below example:
model.add(keras.layers.LSTM(units=3, batch_input_shape=(8,2,10), return_sequence=True, stateful= True))
So I have the following forex data structure where i don't know how to reshape it properly for an LSTM model.
open | close | high | low | volume | i1 | i2 | i3 | ... | i30 | nextClose
These features represents the open/close/high/low prices of a certain currency pair, in addition to the volume and 30 different indicators' values from i1 -> i30, all of these features corresponds to one minuet tick. Besides the nextClose feature represents the next minuet tick close price value that I'm trying hopefully to predict.
Q1: Could anyone please explain the general concept of how the data should be shaped for input, and what are all of these required parameters (time step, batch size...)?
Q2: Where I think a simple example could be great, How should my data structure above be reshaped to look like a valid input for LSTM?