I have a very simple LSTM model
model = Sequential()
model.add(LSTM(64, input_shape=(seq_length, X_train.shape[2]) , return_sequences=True))
model.add(Dense(y_cat_train.shape[2], activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
model.fit(X_train, y_cat_train, epochs=100, batch_size=10, verbose=2)
The input X_train
has 2 feature , one is categorical (values 1-4) and the other is numeric (values 1-100). There are 4 classes in y_test
that I one-hot-encoded with keras's to_categorical
.
- Should I encode the categorical input feature as well ? If I do , how can I pass it along with the other feature ? (e.g. now a timestep looks like this for example:
[1,44]
) - Later , I would like to take make a sampling , meaning I need to take the predicted
y_hat<t-1>
and pass it asx<t>
. I will have to pass the second numeric feature (1-100) along with it. How can it be done ?
EDIT : note that I do not want my numeric feature to become categorical since there is importance to the values (meaning 2<10<90 etc)