8
$\begingroup$

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?: net

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,

$\endgroup$
6
$\begingroup$

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?).

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – user16603 Nov 30 '12 at 18:23
  • $\begingroup$ It is not completely clear, but classification can be achieved by setting ` linear.output=FALSE` in the neuralnet package. ref $\endgroup$ – Mr Tsjolder Feb 11 '16 at 20:47
  • $\begingroup$ Wht's the meaning of the "iter 130 value 119841.088094" and "final value 136242.000000" lines? What are those numbers? $\endgroup$ – skan Dec 5 '16 at 21:10
  • 1
    $\begingroup$ @skan: That is the optimization of gradient descent $\endgroup$ – Andrew Dec 6 '16 at 16:25
5
$\begingroup$

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/

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ 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! $\endgroup$ – Ken Feb 12 '15 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy