I\'m trying to predict the class (0 or 1) for a test dataset using a neural network trained using the neuralnet package in R.
The data I have looks as follows:
I know this is an old post, but I came across a unique piece that may help someone in the future. Thought this post was most applicable as it throws the same error.
Scaling of a dataset must be converted back into a data.frame for use in compute
#scaled data
scaledData=scale(data)
nn=neuralnet(y~x,data=scaledData[train,])
#this repeatedly failed for me
compute(nn,scaledData[test,])
#this worked
compute(nn,as.data.frame(scaledData)[test,])