In the neuralnet package, the function that we will use is appropriately named neuralnet(). Other than the formula, there are four other critical arguments that we will need to examine:
- hidden: This is the number of hidden neurons in each layer, which can be up to three layers; the default is 1
- act.fct: This is the activation function with the default logistic and tanh available
- err.fct: This is the function used to calculate the error with the default sse; as we are dealing with binary outcomes, we will use ce for cross-entropy
- linear.output: This is a logical argument on whether or not to ignore act.fct with the default TRUE, so for our data, this will need to be FALSE
You can also specify the algorithm. The default ...