1
$\begingroup$

Is it possible to have non-binary labels for LSTM? I mean an array like

[ 100 120 140 20 50 70]

Instead of

[1 0 1 0 0 1 1]

for example! Isn't this opposite of LSTM's essence and doesn't reduce it's performance?

$\endgroup$
1
$\begingroup$

Welcome to the site. Generally speaking, you can have any labels you need/want and I don't think that the "essence" of LSTM will be affected. Recall that LSTM is special because it has the ability to "forget" and throw away data (mostly data that leads to factor fading). So, your choice of labels will not prevent you from leveraging the wonderful benefits of LSTM.

However, it's possible that you are confusing your question with one-hot-encoding. You should definitely take your labels and convert them to one-hot-encoding during both your training and prediction cycles. You're not changing your labels per-se, you're merely creating them in a way that allows you to better use them in neural networks (all neural networks; one-hot-encoding is not unique to LSTM).

$\endgroup$
1
  • $\begingroup$ Thank you bro, but I am trying to use LSTM for stock prediction, so my inputs are different numbers(opening/high/low/close prices), and my labels are different numbers as well(like my input). In fact I am trying to predict tomorrow's prices, so I think I need labels with different numbers like my input not a one-hot-encoded vector. $\endgroup$ – user3486308 Feb 15 '19 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.