0

I have the following dataframe named train in R:

rsro xo x1 x2 x3     rv           br
   4  0  0  0  0 8.4467 0.3337061885
   1  1  0  0  0 8.0676 0.3435027205
   0  0  0  0  0 9.0288 0.2894759898
   0  1  0  1  0 8.7164 0.3014924009
   0  2  0  0  0 7.9183 0.3894641113

I'm training a neural net algorithm with this call:

nn=neuralnet(rsro ~ xo + x1 + x2 + x3 + rv + br, 
             data=train, linear.output=F, hidden = c(4,2))

But I get this error:

Error in neurons[[i]] %*% weights[[i]] : requires numeric/complex matrix/vector arguments

I have checked all my variables, and there are no missing values and they are all numeric. There have been several other questions here about this error, but all seemed to be solved by eliminating missing or non-numeric values. How do I fix this?

Community
  • 1
  • 1
japem
  • 1,037
  • 5
  • 16
  • 30
  • 1
    With the data you provided it works for me. Do you get the error with your sample data? Can you provide `str(train)`? Are you using `neuralnet::neuralnet`? – slamballais Feb 17 '16 at 16:48
  • This works for me too. I did notice when I typed `library(neuralnet)` that a few `objects` (like `select` from `dplyr`) were masked. It could be possible that libraries loaded after `neuralnet` are masking objects in `neuralnet`. – steveb Feb 17 '16 at 17:06

0 Answers0