Palace Chan
Palace Chan

Reputation: 9183

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 outputting probabilities so I wanted logistic units and so I turned to multinom from the nnet package to output type='probs' in my predict function. How can I pass down a size argument? When I call it with, say, size=5 or something I get an error:

 formal argument "size" matched by multiple actual arguments

Upvotes: 4

Views: 2099

Answers (1)

Hong Ooi
Hong Ooi

Reputation: 57686

multinom fits linear multinomial logistic models, which is why the size parameter is hardcoded to 0. If you want an actual neural network with multinomial outputs, just use nnet with a response with more than 2 levels, and set softmax=TRUE.

Upvotes: 8

Related Questions