2
$\begingroup$

The problem I'm solving is a regression problem using neural networks, and the "y" value covers a very large range (let's say y represents the number of people, ranging from 0 people to 10000 people), which makes it impossible to be interpreted as a classification problem.

The only difference between the problem I'm solving right now and the ordinary regression problem is that the output neuron should produce a strict integer, not decimal.

Is there any activation function that can handle this constraint? Or what's the appropriate way to approach to model this constraint?

$\endgroup$
0
$\begingroup$

You are correct to approach this as a regression problem, mostly because you are interested in the order of your outputs. For example if there are 1000 people present and you predict 1005, it's a better prediction than 7005. If you were treating this as a classification problem, both of these would be interpreted as missclassifications.

The most practical way to approach your constraint is to round the output of your neural network, i.e. if it outputs 3456.78, round it up to 3457. You need to have a linear activation function to be able to use the NN for regression.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your answer $\endgroup$ – o_yeah Jun 1 at 18:10
0
$\begingroup$

One approach could be to regress a contineous value, and apply a rounding afterwards.

Then, you are looking for a neural network that maps an input to a value y >=0. There are many activation functions which you could use, for example linear and quadratic functions. According to the Universal Approximation Theorem, you should use non-linear activation functions.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your answer. $\endgroup$ – o_yeah Jun 3 at 2:06

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.