Using RGUI. I have a dataset called Data. The response variable of interest to me is contained in the first column of Data .
I have Data training sets called DataTrain and DataTest .
With DataTrain I trained a neural network model (called DataNN ) using the package and neuralnet function.
> DataNN = neuralnet(DataTrain[,1] ~ DataTrain[,2] + DataTrain[,3], hidden = 1, data = DataTrain)
Does anyone know how to create a forecast for this model using a test suite ( DataTest )?
Normally (for other models) I would use predict() for this. For example.
> DataPred = predict(DataNN, DataTest)
But when you do this for neuralnet , I get:
> DataPred = predict(DataNN, DataTest) Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "nn"
Obviously, I cannot run predict() on this model. Does anyone know any alternatives?
I checked the help for neuralnet and I found a method called prediction on page 12 of the documentation . I donโt think that this is generally what I want, or at least I donโt know how to apply it to my Data .
Any help would be appreciated (if at all there is any solution).
Brian
source share