# Why there is two output in Titanic case in tflearn quickstart?

I am stuck in the tflearn quickstart guide.

I've tried tit and it works perfectly with accuracy around 78%, but the problem is I don't understand why the "labels" consist of two "survived" columns that are the opposite of each other. I've trained the same data but used only single "survived" column in the labels or the output, but with the same code I just get around 36% with 0 loss or even NaN loss.

So why is there two columns output/labels? And why can't I use only a single column?

• The output is one, the classes are 2 and hence when converted to categorical column, have two columns – enterML Dec 24 '17 at 12:28
• @Nain so if i have 3 output, the classes will be 6? – Zahi Azmi Dec 25 '17 at 9:12
• Nope, it would be three only – enterML Dec 25 '17 at 14:16

Since you have only one binary target to predict (survived vs not survived) you can use only one output (that provide the probability of surviving). The problem with this approach is that you can not longer use softmax activation, since it will always be 1. Remember that softmax activation has the form $$g(x_k)=\frac{e^{x_k}}{\sum_{i=1}^n e^{x_i}}$$ Since you have only one element to run the activation it will be normalized always as 1. It is used mostly for categorical prediction (i.e. among several possibilities only one is correct). You are getting $0$/$NaN$ loss because your model always return 1. Instead of using softmax activation you might try sigmoid activation, so you can interpret the result of the network evaluation as the probability of survive.