I have an input dataset (matrix 25x2275) which is normalized to values between 0 and 1. I also have a binary formatted output matrix (3x2275) like 0 0 0 0 0 0 0 0 1, 1 0 0 1 1 1 0 0 1 ...

I imported both files in matlab nntool and it automatically created a network with 25 input and 3 output nodes as I wanted.

After I trained this network using feed-forward backProp, I tested the model in its training data and each output nodes returns a decimal value like (0.9999 0.978 1 0 0.99 0.59368 0.38359 0.31435 1.0604).

Why it doesn't return discrete values like 1 0 0 1 1 1 0 0 1? Is there any thing that I must set in nntool to get such values?


1 Answer 1


Even for classification problem, the output activation can be any slashing function like sigmoid, tanh, using which the error is back-propagated.

I guess, its trying to give you continuous value for a labels more like probabilities, you use a cut off (say 0.5) and convert the values to 0 and 1 labels

  • $\begingroup$ Thank you.I am using SOFTMAX activation funtion.But,it still give output in floating numbers just like 0.500 $\endgroup$ Jul 11, 2017 at 9:38
  • $\begingroup$ Hey Case, just for your information, if you use softmax the sum of output values should add up to 1. Its kind of probability of an output label over all other output labels. For your output it does not look the same. $\endgroup$
    – Abhishek
    Jul 11, 2017 at 11:22
  • $\begingroup$ Also for a multi class problem, as seen from your values, softmax might not be the best choice, you can try sigmoid activation $\endgroup$
    – Abhishek
    Jul 11, 2017 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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