I'm having difficulties to wrap my head around how I can prepare my dataset to train an LSTM.
Below is a screenshot of a subset representation of my dataset.
There are several other feature not included in this screenshot. The last column is inhospital_mortality which is 0 or 1 for each row.
Each feature was taken at a certain time x. features with the same feature_1,2,3 were taken at the same time.
My idea is that I will need to break every row (sample) as the example below: So in this case, each row would become 6 new rows.
| tc_tb1 | spo2_tb1 | g1_tb1| inhospital_mortality (label 0 | 1) | | tc_tb2 | spo2_tb2 | g1_tb2| inhospital_mortality (label 0 | 1) | | tc_tb3 | spo2_tb3 | g1_tb3| inhospital_mortality (label 0 | 1) | ... | tc_tb6 | spo2_tb6 | g1_tb6| inhospital_mortality (label 0 | 1) |
Am I correct here? If so, how could I accomplish this dataframe manipulation in a more straight forward way? Perhaps there's a better way to reshape turn this dataset into the format I want. I wasn't able to accomplish it.