# Interpreting the neural network output in R?

I managed to create neural network of my data. But I am not so sure about the interpretation of the R output. I used following command to create neural network:

> net=nnet(formula = category~iplen+date_time, size=0,skip=T,lineout=T)
# weights:  3
initial  value 136242.000000
final  value 136242.000000
converged


Then I used following command to see the output:

    > summary(net)
a 2-0-1 network with 3 weights
options were - skip-layer connections
b->o i1->o i2->o
0.64 -0.46  0.15


So from the above output Can I can conclude the following diagram of neural network?: Second question is how can I know how useful this diagram is? I mean I wanted to find the category number(target variable) from the independent variables. so now how can I decide if this network really helped me to predict the category(target variable)? What is the final output or how to find that?

Can I conclude the following output from the above n-network? :

category= -0.46(iplen)+0.15(date_time)+0.64


Regards,

Your interpretation looks correct. You can check it yourself by calling predict on some data and comparing your calculations to predict. I first did this in a spreadsheet, and then I calculated an R neural network using metaprogramming.

By the way, the R package neuralnet draws nice diagrams, but apparently it supports only regression (not classification?).

• Andrew, Thanks for the reply. One more thing I wanted to discuss that as I got a equation: category=-0.46(iplen)+0.15(date_time)+0.64 from nnet output. now can I compare this with my regression equation that I can create after doing linear regression as follow: lm(category~iplen+date_time) and then linear regression equation will be something like: category=ß1(iplen)+ß2(date_time)+ß0 – user16603 Nov 30 '12 at 18:23
• It is not completely clear, but classification can be achieved by setting  linear.output=FALSE in the neuralnet package. ref – Mr Tsjolder Feb 11 '16 at 20:47
• Wht's the meaning of the "iter 130 value 119841.088094" and "final value 136242.000000" lines? What are those numbers? – skan Dec 5 '16 at 21:10
• @skan: That is the optimization of gradient descent – Andrew Dec 6 '16 at 16:25

you can also use the following code for plotting nnet results

install.packages("devtools")
library(devtools)
source_url('https://gist.githubusercontent.com/fawda123/7471137/raw/466c1474d0a505ff044412703516c34f1a4684a5/nnet_plot_update.r')

#plot each model
plot.nnet(net)


reference : https://beckmw.wordpress.com/tag/nnet/

• Hm, that's interesting, but doesn't plot very well in my case (doesn't seem to want to put weight information). Still, upvoting since having more tools is better than having less! – Ken Feb 12 '15 at 5:17