[R] use nnet

Aimin Yan aiminy at iastate.edu
Fri Mar 9 19:22:17 CET 2007


I want to adjust weight decay and number of hidden units for nnet by 
a loop like
for(decay)
{
  for(number of unit)
   {
    for(#run)
     {model<-nnet()
       test.error<-....
     }
   }
}

for example:
I set decay=0.1, size=3, maxit=200, for this set I run 10 times, and 
calculate test error

after that I want to get a matrix like this

decay  size   maxit  #run  test_error
0.1        3        200   1       1.2
0.1        3        200   2       1.1
0.1        3        200   3       1.0
0.1        3        200   4       3.4
0.1        3        200   5        ..
0.1        3        200   6         ..
0.1        3        200   7       ..
0.1        3        200   8      ..
0.1        3        200   9       ..
0.1        3        200   10       ..
0.2        3        200   1       1.2
0.2        3        200   2       1.1
0.2        3        200   3       1.0
0.2        3        200   4       3.4
0.2        3        200   5        ..
0.2        3        200   6         ..
0.2        3        200   7       ..
0.2        3        200   8      ..
0.2        3        200   9       ..
0.2        3        200   10       ..

I am not sure if this is correct way to do this?
Does anyone tune these parameters like this before?
thanks,

Aimin



More information about the R-help mailing list