Is it possible to use Recurrent NN (LSTM) for classification? I have a dataset C of 50,000 (binary) samples each of 128 features. The class label is also binary either 1 or -1. For instance, a sample would look like this [1,0,0,0,1,0, .... , 0,1] [-1]. My goal is to classify the samples based on the binary classes( i.e., 1 or -1). I thought to try using Recurrent NN (LSTM) to generate a good model for classification. For that, my question is: Is it possible to use Recurrent NN (LSTM) for such a classification problem?

tr_C, ts_C, tr_r, ts_r = train_test_split(C, r, train_size=.8)
batch_size = 1000

print('&gt;&gt;&gt; Build STATEFUL model... (%s, %s)' % (tr_C.shape[1], tr_C.shape[2]))
model = Sequential()
model.add(LSTM(129, batch_input_shape=(batch_size, C.shape[1], C.shape[2]), return_sequences=False, stateful=True))
model.add(Dense(1, activation='relu'))

print('&gt;&gt;&gt; Training...')
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
model.fit(tr_C, tr_r,
          batch_size=batch_size, epochs=1, shuffle=True,
          validation_data=(ts_C, ts_r))


Thank you
Yes, it is possible. You will first use a LSTM layer and then use a Dense/Linear layer on top of it to get the final output. Make sure that your linear layer has number of outputs = number of classes.