I'd like to get a recommendation how to attack a problem of predicting multiple numbers. Training data contains 4 columns, each says a probability of record being in the bucket. So, for example: X = [0.25, 0.5, 0.25, 0.0] and corresponding output should be e.g. Y = [0.8, 0.1, 0.0, 0.1]. Each row should sum to 1.0

What type of approach would you recommend?

I already tried simple neural network with 4 neurons in the last layer and softmax activation but wondering if there is a better solution.


  • $\begingroup$ What's Y? softmax tends to give a low variance probabilty $\endgroup$
    – David Taub
    Commented May 28, 2018 at 12:10
  • $\begingroup$ let's say I have a system that estimates a age distribution in a group of people. X says their age distribution. For example x[0] is 0-18 years, x[1] = 19-40 years, x[2] = 41-60 years and x[3] is 61+ years. x[0] = 0.25 means 25% of people belong to the age group 0-18 years. And Y contains real distribution. $\endgroup$ Commented May 28, 2018 at 12:19
  • $\begingroup$ Still confused. When creating the dataset, how did you create X and Y? Also, how will you use the predictor afterwards? $\endgroup$
    – David Taub
    Commented May 28, 2018 at 13:00
  • $\begingroup$ You can have an image of people and would like to estimate their ages. There is a system that generates these estimates (X) but I know it's not entirely correct (because I have several thousands of manually labelled images) and I'd like to build a system that reduce the error. HTH $\endgroup$ Commented May 28, 2018 at 13:05

1 Answer 1


I would recommend using an encoder-decoder structure based on LSTM-RNN for sequence-to-sequence learning; it will provide you with exactly what you want. A link that I find very helpful is:


  • $\begingroup$ Thanks a lot for your suggestion, it is very interesting. Unfortunately, I think using seq 2 seq approach I think I can't guarantee that generated numbers will sum to 100%. $\endgroup$ Commented May 31, 2018 at 19:47
  • 1
    $\begingroup$ True. What you can do is to insert a custom "Lambda Layer" AFTER the seq2seq structure to sum all the outputs into 1 and train the network to learn it! Take a look at how Lambda Layers works in Keras documentation and also check this very helpful example [stackoverflow.com/questions/44886195/… :) $\endgroup$
    – pcko1
    Commented May 31, 2018 at 19:55

Your Answer

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

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