I am working on multivariate time based LSTM RNN Project. Because it is a multivariate, my goal is to train the model with multiple parameters and as an output I want to get predictions for every parameter in the dataset. I will add all the code and information below.
Here is the data set
Time(sec) Lat(deg) Lon(deg) Alt(m) Yaw(deg) Pitch(deg) Roll(deg) Vx(m / sec) Vy(m / sec) Vz(m / sec)
0 1.00 42.461525 33.000000 2802.544922 0.000000 0.000000 0.000000 150.000000 0.000000 -0.000000
1 1.02 42.461525 33.000000 2802.544922 0.000000 0.000000 0.000000 150.000000 0.000000 -0.000000
2 1.04 42.461579 33.000000 2802.544922 0.000000 0.000000 0.000000 150.008987 0.000000 -0.000000
3 1.06 42.461579 33.000000 2802.544922 0.000000 0.000000 0.000000 150.008987 0.000000 -0.000000
4 1.08 42.461633 33.000000 2802.544922 0.000000 0.000000 0.000000 150.035843 0.000000 -0.000000
and here is the reshaping code for that data set:
trainX = [] trainY = []
n_future = 1
n_past = 100
for i in range(n_past, len(df_missile_training_scaled) - n_future +1):
trainX.append(df_missile_training_scaled[i - n_past:i, 0:df_missile_training_scaled.shape[1]])
trainY.append(df_missile_training_scaled[i + n_future - 1:i + n_future, 0])
with this code i am reshaping the input as I wanted but it only outputs first column "Lat(deg)" because of the shape of the trainY.
trainX, trainY = np.array(trainX), np.array(trainY)
print('trainX shape == {}.'.format(trainX.shape))
print('trainY shape == {}.'.format(trainY.shape))
Outputs;
trainX shape == (171900, 100, 9). trainY shape == (171900, 1).
My goal is to change it to a shape that after the training, model can predict multiple parameters (columns) on one training.
I tried this code but some how it gives me;
trainY shape == (171900, 1).
Here is the code I tried:
trainX = []
trainY = []
n_future = 1
n_past = 100
for i in range(n_past, len(df_missile_training_scaled) - n_future +1):
trainX.append(df_missile_training_scaled[i - n_past:i, 0:df_missile_training_scaled.shape[1]])
trainY.append(df_missile_training_scaled[i + n_future:df_missile_training_scaled.shape[1]])
My question is how can I do this reshaping properly. And what I'm aiming for can be done for the neural network model?
I hope I was able to explain my question. If there is something I missed or couldn't explain, I can add it. Thanks in advance for reading