# Classification model using RNN(action detection)

1. 1) Could it be useful to use RNN for classification problem?(e.g. to distinguish which action is taken: car is going, walking, digging, nothing).
2. If 1 question is positive, how should RNN structure look like?

I have dataset of 4 actions, many examples for each action, each example includes 124 samples. So my X_train, X_test are arrays of float(400000, 124, 1); y_train, y_test are arrays of int(0 or 1 or 2 or 3 depends on action).

My data preprocessing:

X_train, X_test, y_train, y_test = np.array(X_train), np.array(X_test), np.array(y_train), np.array(y_test)
X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))
X_test = np.reshape(X_test, (X_test.shape[0], X_test.shape[1], 1))

My structure:

regressor = Sequential()
regressor.add(LSTM(units=55, return_sequences=True, input_shape=(X_train.shape[1], 1)))

regressor.fit(X_train, y_train, epochs=5, batch_size=32)
y_pred = regressor.predict(X_test)
• If I understand correctly, you are asking if RNN can be used for classification? Any reason why you are thinking in this way? Feb 17, 2020 at 10:33
• yes. i have 124 samples(values) for one example of specific action. i have many examples of each action; and correlation of these 124 values is similar among examples of specific action but is different comparing to example of another action. So i'd love my network could extract this correlation and thanks to this be good at predicting a final result. In my opinion RNN should be great in finding this correlation(possibly i'm wrong). @NischalHp Feb 17, 2020 at 11:00
• What is the type of data you are working with? Its textual or numeric? How many features quantify as 1 sample? Feb 17, 2020 at 12:23
• Type is float64; 124 features for one example. @NischalHp Feb 17, 2020 at 13:02