Skip to main content
added 227 characters in body
Source Link

I am new to RNN, and I do not know how to transform my input data in order to use it in a LSTM layer.

Currently, my input data has (1000 samples, 50 features). But let´s say it is only (1000 samples, 2 features) to make the example below easier. Each sample would look like this:

[Date, Score, team_id]
1.[11/10/2022, 56, 23543]
2.[12/10/2022, 75, 44354]
3.[17/10/2022, 56, 44354]....

I would like to use 5 time steps, so my data will have a shape like this (1000, 5, 50). I know I would need to get the 5 previous scores for all samples, but once I do that, I do not understand how to represent the data. I guess it will be like a list of matrices, but how is that coded from the dataframe I have?

UPDATE! I have created the list of matrices where if you print(list[0]), you get an array of dicts with the information, so we could say it is a list of lists of dicts. How do I convert that into a dataframe or input data?

Thank you very much

I am new to RNN, and I do not know how to transform my input data in order to use it in a LSTM layer.

Currently, my input data has (1000 samples, 50 features). But let´s say it is only (1000 samples, 2 features) to make the example below easier. Each sample would look like this:

[Date, Score, team_id]
1.[11/10/2022, 56, 23543]
2.[12/10/2022, 75, 44354]
3.[17/10/2022, 56, 44354]....

I would like to use 5 time steps, so my data will have a shape like this (1000, 5, 50). I know I would need to get the 5 previous scores for all samples, but once I do that, I do not understand how to represent the data. I guess it will be like a list of matrices, but how is that coded from the dataframe I have?

Thank you very much

I am new to RNN, and I do not know how to transform my input data in order to use it in a LSTM layer.

Currently, my input data has (1000 samples, 50 features). But let´s say it is only (1000 samples, 2 features) to make the example below easier. Each sample would look like this:

[Date, Score, team_id]
1.[11/10/2022, 56, 23543]
2.[12/10/2022, 75, 44354]
3.[17/10/2022, 56, 44354]....

I would like to use 5 time steps, so my data will have a shape like this (1000, 5, 50). I know I would need to get the 5 previous scores for all samples, but once I do that, I do not understand how to represent the data. I guess it will be like a list of matrices, but how is that coded from the dataframe I have?

UPDATE! I have created the list of matrices where if you print(list[0]), you get an array of dicts with the information, so we could say it is a list of lists of dicts. How do I convert that into a dataframe or input data?

Thank you very much

Source Link

Input Data for LSTM RNN transformation

I am new to RNN, and I do not know how to transform my input data in order to use it in a LSTM layer.

Currently, my input data has (1000 samples, 50 features). But let´s say it is only (1000 samples, 2 features) to make the example below easier. Each sample would look like this:

[Date, Score, team_id]
1.[11/10/2022, 56, 23543]
2.[12/10/2022, 75, 44354]
3.[17/10/2022, 56, 44354]....

I would like to use 5 time steps, so my data will have a shape like this (1000, 5, 50). I know I would need to get the 5 previous scores for all samples, but once I do that, I do not understand how to represent the data. I guess it will be like a list of matrices, but how is that coded from the dataframe I have?

Thank you very much