Reputation: 23
I am new to neural networks and LSTMs, hence need some help here.
I have 100 files of varying time lengths and each file has 13 features each. Each file represents an output class.
Now, I want to have a LSTM network which can classify these timeseries files. How should I go about it? How should I process/prepare my data? What should the input to the network be like?
Thanks in advance.
Upvotes: 2
Views: 2008
Reputation: 367
You will be using many-to-one configuration of RNN for the purpose of classification task. You will feed your sequence of time series to the network and the network will then produce single output for you.
Now, you will prepare your data in the shape (samples, timesteps, features) and labels to be the shape (label, ). Then your test set will follow the same format. For example, you have a set of 50 videos, 30 seconds per video and 100 pixels per frame. Below is the explanation of what each term in the shape means:
samples: These are the samples and one sample may contain multiple timesteps. It will be 50 in case of mentioned example.
timesteps: It is the number of timestep you have to look behind in time while predicting current step. It will be 30 for mentioned examples as you will be look behind 30 timesteps to predict something about the video. Often, It may depend on your choice and requirement what number you choose.
features: These are the features/attributes per timestep. It will be 100 for the mentioned example.
label: These are the label for each sample. The shape of it changes according to your needs.
So, for our example of videos the training will be with shape (50, 30, 100) and labels will be with shape (50, ). The test data will have shape ( None, 30, 100). Here, None donates that it can be 'any' and this specifies that you can have any number of samples in test data for prediction.
For more reference and explanation about LSTM, look at: this video
And also you might be interested to follow this link, this, and this. And also check this if it benefits you.
Also please make sure you learn and do something and come here to ask about the problems you encounter while doing that. Thank you :)
Upvotes: 4