I am using neuralnet package for training a classifier. The training data looks like this:
> head(train_data)
mvar_12 mvar_40 v10 mvar_1
I just came up against the very same problem. Checking the source code of the compute function we can see that it assumes one of the resulting attributes (i.e. weights) only defined when the network finishes the training flawless.
> trace("compute",edit=TRUE)
function (x, covariate, rep = 1) {
nn <- x
linear.output <- nn$linear.output
weights <- nn$weights[[rep]]
[...]
}
I think the real problem lies on the fact that neuralnet doesn't save the current network once reached the stepmax value, causing this error later in the compute code.
Edit
It seems you can avoid this reset by commenting lines 65 & 66 of the calculate.neuralnet function
> fixInNamespace("calculate.neuralnet", pos="package:neuralnet")
[...]
#if (reached.threshold > threshold)
# return(result = list(output.vector = NULL, weights = NULL))
[...]
Then everything works as a charm :)