Skip to content
Prev 385519 / 398503 Next

Odd Results when generating predictions with nnet function

Generically, nnet(a$y ~ a$x, a ...) should be nnet(y ~ x, data=a, ...) otherwise predict will go looking for a$x, no matter what is in xnew. 

But more importantly, nnet() is a _classifier_, so the LHS should be a class, not a numeric variable.

-pd