2

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.

  • Your question appears to be too much vague. First of all make it clear in mind what are your requirements and what are the requirements of LSTM to predict output according to your needs. What do you mean by features? Features are 'column' or your mean 'timesteps' by them? Can you show the example how your file data look like? – Fawad Khalil Oct 18 '17 at 00:06
  • @FawadKhalil, I have 100 files (each belonging to one subject) and in each file there are 13 different sensor data columns(say, sensor 1, sensor2,...sensor13). It is for classifying human activity i.e. whether he is walking/running/sitting/standing etc. I want to implement a classifier for it using LSTM as it can contain the contextual information for long. Now my question basically is, how do I feed this data to LSTM network? How should I process it? Should I separate the time series and have Uni variate sequence classification or can I feed all these time series to one network only? – Tej Singh Chani Oct 18 '17 at 19:41

1 Answers1

4

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 :)

Fawad Khalil
  • 357
  • 3
  • 20