[R] help ANN

S Ellison S.Ellison at lgcgroup.com
Fri Nov 29 14:49:34 CET 2013


> I would like to create an artificial neural network with R but I don't know its
> parameters jet (number of layers, number of neurons,...).
> I downloaded the package ANN and I use the function "ANNGA", but I'm
> afraid I haven't really created a neural network. In fact, at the end of the
> process I have just this output:
> 
> Call:
> ANNGA.default(x = input, y = output, design = c(1, 3, 1), population = 100,
>     mutation = 0.2, crossover = 0.6, maxW = 10, minW = -10, maxGen = 1000,
>     error = 0.001)
> 
> **********************************************************
> ******************
> Mean Squared Error------------------------------> 0.01148523
> R2----------------------------------------------> 0.6918387
> Number of generation----------------------------> 1001 Weight range at
> initialization------------------> [ 10 , -10 ] Weight range resulted from the
> optimisation-----> [ 13.58698 , -12.93606 ]
> **********************************************************
> ******************
> 
> Well, I would like to know if there is in ANN a function to *create* a neural
> network and if not, which package I have to download, Nnet?

What you have done is create an ANN object, print it's summary information and then discard it.

if you want to keep it and use it for something, assign it to a variable; for example:

my.ANN <- ANNGA.default(x = input, y = output, design = c(1, 3, 1), population = 100,
     mutation = 0.2, crossover = 0.6, maxW = 10, minW = -10, maxGen = 1000,
     error = 0.001)

You can then inspect, print, or predict with the object my.ANN. For example, you can say simply 
predict(my.ANN) 

to see the output values predicted for the inputs you supplied.

This goes for a lot of R fitting functions; they return objects which are printed and discarded unless you assign them to something.


S Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list