# Choosing loss function in Keras for prediction binary_crossentropy or categorical_crossentropy

What loss function in keras should I chose for binary_crossentropy or categorical_crossentropy?

I have data like : $$w1,w2,w3,w2,w2,w1,w3,w5,w9,w5,w4...$$

I want to predict sequence:

input: $$w1,w2,w3$$ -> $$LSTM$$ -> get output: $$w2,w2,w1$$

I encoded the symbols $$w1,w2...$$ by obe-hot-encoding

So the input of the model is : $$[[1,0,0],[0,1,0],[0,0,1]]$$

The output of the model is : $$[[0,1,0],[0,1,0],[1,0,0]]$$

• You are using multiple outputs/classes which needs categorical_crossentropy. Also, elaborate your question with some information in order to receive proper guidance. May 29 '19 at 11:44
• You can't predict a sequence with ML. You can predict a time series, but a time series requires at least a good handful of features per point in the series. (P.S. the mathematical meaning of sequence vs. series is analogous - although not exactly the same - the difference between your data and a series that ML could be capable of predicting) May 30 '19 at 23:30