When using the multinom function from the nnet package, how can I control the architecture of the neural networks?

In other words, when I do nnet(...)

, I can use the size parameter to control the number of units in the hidden layer. My particular model requires the inference of probabilities, so I need logistic units, and so I switched to multinom from the nnet package to output type = 'probs' in my prediction function. How do I pass the size argument? When I call it, say size = 5 or something, I get an error:

 formal argument "size" matched by multiple actual arguments

      

+3


source to share


1 answer


multinom

suitable for linear multivariate logistic models, so the size parameter is hardcoded to 0. If you want a real neural network with multiple outputs, just use nnet

with an answer with more than two levels and set softmax=TRUE

.



+5


source







All Articles