Setting hidden layers and neurons in neuralnet and caret (R)
问题 I would like to cross-validate a neural network using the package neuralnet and caret . The data df can be copied from this post. When running the neuralnet() function, there is an argument called hidden where you can set the hidden layers and neurons in each. Let's say I want 2 hidden layers with 3 and 2 neurons respectively. It would be written as hidden = c(3, 2) . However, as I want to cross-validate it, I decided to use the fantastic caret package. But when using the function train() , I