0
$\begingroup$

I am a little confused about how to handle binary variables and continuous variables before being fed into a neural network in R. Please can you confirm that I should normalize all variables to fall between 0 and 1 to ensure each variable has the same input weight?

For example I have one variable which is color and I have converted this to binary (i.e. Blue=1 or 0, yellow = 1 or 0 and so on), I also have another variable that has sizes in mm ranging from 7 mm - 1500 mm. What would be the best way to normalize all this data so that it is all on the same sort of scale?

$\endgroup$

1 Answer 1

0
$\begingroup$

Normalizing your input is generally a good idea in order to achieve a well-defined problem. If you don't normalize, your training might be very slow or might end up in a local minimum. The intuitive explanation is that if you have a variable with very large variables, the change in weights from back-propagation will be very different than for any other (smaller) variables.

The variables don't necessarily need to fall between 0 and 1, in fact it is generally recommended to normalize with a mean of 1 and a standard deviation of 1. Your approach should also work however.

The above is only about simple normalization/rescaling. If you have very noisy or assymetrical data, you might also consider transformation to make your input more smooth. See also this. In theory the neural network should be able to handle most of the alinearity in your data though, provided you use non-linear activation functions.

$\endgroup$

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.