Hello, I want to train a Neural Network
and pass it a custom error measure function.
For example, I tried the following:
rmse = function(error) sqrt(mean(error ^ 2))
nn <- neuralnet(score ~ ., data = ds_trn_noc, hidden = 2, err.fct = rmse)
but got the following error:
Error in eval(expr) : generic 'function' is not a function
My goal is that when I run the command:
> nn$result.matrix
I get the following output:
## [,1]
## error 1.988157e+02
## reached.threshold 9.903357e-03
## steps 4.576900e+04
...
...
...
where the error is calculated by my custom function: rmse
.
Any idea about what's wrong on my code above?
Thanks!