I have an array that I would like to reshape for the purposes of training an LSTM in Python. This is what my array looks like:
[[0,0,0,0,1]
[1,0,0,0,0]
[0,0,0,1,0]
[0,1,0,0,0]]
In this above example, there are 5 features. The other 4 features at that point are set to 0, and one feature is 1. I would like to reshape this using the (sample,timestep,feature) to create a 3D array.
I am using numpy, and naturally, the .reshape() function would work great.
np.array(x_list).Noneadds a dimension to make it (1, 4, 5) in your case. 1 is the sample size in this case. You would want a lot more samples for a LSTM.