If you have some input nodes containing fruit values like {apple=0, pear=1, oranges=2} vs temperature values like {5, 10, 30, 50}.

Is there any difference on how you set up the neural network to learn the output?

I'm guessing on the first case the neural network only learn about the input you used to train. For example if you then try with banana the result will be something random.

But in the case of temperature if I input 35 I would expect a result similar to 30.

Also, I'm guessing for the first case would need much more data to learn than the second case. So wondering if have to take different consideration on each case.

  • $\begingroup$ A neural network cannot have an input node containing fruits; you (or your software) needs to encode that data somehow, and the type of encoding chosen will affect the answer. $\endgroup$ – Ben Reiniger Dec 30 '20 at 16:23
  • $\begingroup$ Yes I was thinking {apple=0, pear=1, oranges=2}, I update the question @BenReiniger $\endgroup$ – Juan Carlos Oropeza Dec 30 '20 at 16:33
  • $\begingroup$ I know when you input the training data one of the steps is normalizing. So that is why an input in a ranged value like temperature seem should be handled differently than discrete values. $\endgroup$ – Juan Carlos Oropeza Dec 30 '20 at 16:36

If categorical values are 1-hot encoded, then there is a node for each item in the category. There would be an input note that indicate the presence or absence of a categorical value. There would be an apple node, a pear node, or a orange node. If apple is present, then the apple input node would take a value of 1; 0 otherwise.

Numerical values have one node per feature. The activation node have higher value if the numerical value is higher. Typically, these input node are rescaled between 0 and 1. The activation of an input node can take on any value between 0 and 1.

In the case of temperature, it depends on how temperature is measured. If temperature is measured continuously, then it can be encoded as a numerical value. If temperature can only take a limited subset of values, then can not be encoded as a numerical value. It would be measured on a ordinal scale.


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.