I'm building a neural network in R with the neuralnet package, and the data contains categorical values.
I have converted the columns into dummy variables, but I have a couple of questions:
- I need to normalize the dummy variables, correct? ( ($X_i$ – column mean)/column standard deviation )
- Do I need to use the softmax activation function? Only on the output activation function?
- If so, how do I set this in neuralnet?
Contents
hide
Best Answer
- You do not need to normalize dummy variables. In my experience NN implementation algorithms work better when weights are in the [-5,5] range. With 0,1 that is exactly the case. In fact many people reccommend scaling to (0,1) range.
- You don't need softmax if your predictors are categorical. On the other hand if your predicting variable is multi-class categorical you need softmax because the standard algorithm works with only two categories on the output variable.
- You should consider using nnet instead of neuralnet. Altough nnet has less choices, it is probably what you need if you want a simple model. nnet allows for softmax and could be more robust using decay.
Similar Posts:
- Solved – which neural network to use
- Solved – Rescaling input features for neural networks regression
- Solved – R – how can I use neural networks for a binary dependent variable in R
- Solved – Is a neural network consisting of a single softmax classification layer only a linear classifier
- Solved – Is a neural network consisting of a single softmax classification layer only a linear classifier