Search code examples
neural-networkhyperparametersnnet

What is an appropriate value of the parameter "Size" in nnet function in R?


I read somewhere that is should be which.is.max of the nnet model. Is there a rule of thumb to define the value for Size ?


Solution

  • Unfortunately, a single appropriate size hyperparameter does not exist. This value (as well as weight decay) depends on the data and the application at hand. Cross-validation procedures may provide you with decent values for a specific dataset. You should try Random search or Grid Search, which are two basic (yet effective) approaches to this problem. I also recommend you to check this thread about how to choose the number of hidden layers and nodes in a feedforward neural network.