[R] On the Use of the nnet Library
yukiasais at ybb.ne.jp
Tue Aug 19 17:51:30 CEST 2003
I am trying to solve a problem by the neural network method(library:
nnet). The problem is to express Weight in terms of Age , Sex and Height
for twenty people. The data frame consists of 20 observations with four
variables: Sex, Age, Height and Weight. Sex is treated as a factor, Age
and Weight are variables normalized to unity, as usual. I wanted to
construct a neural network, and so I ran the following code:
>net1<-nnet(Weight~Age+Sex+Height, size=2, linout=T,maxit=1000)
I repeated this thirteen times. I used the default initial parameters
unless otherwise noted. The result is as follows, where init and final
mean initial and final RSS's, and NIT means the number of iterations
before reaching convergence or noncovergence:
Run# init NIT final
1 71991.1 30 995.1
2 70870.0 370 33.1
3 72755.8 <10 2134.3
4 69840.6 <10 2134.3
5 70368.8 190 39.7
6 70368.8 270 41.0
7 71101.2 190 39.7
8 71606.1 <10 2134.3
9 72076.1 <10 2134.3
10 72249.1 300 15.0
11 71424.1 <10 2134.3
12 68483.8 130 39.7
13 71435.9 >1000 4.6
As you can see, the result is far from stable.
My question is:
How can I reach a stable answer?
.I know that initial parameters are crucially important in my case, and I
must choose proper parameter values, but I do not know I can do that.
My second question is related to the response analysis of this data. I
do not know an effective method to evaluate the response to
the variance of each explanatory variable. Is there such a function in
the library, nnet? Such a function may help me reduce the number of the
I wonder if anyone could help me in such elementary questions.
---- It's elementary, Watson!
I remain an obedient Watson, hoping for Holmes' wisdom.
Yukihiro Ishii <yukiasais at ybb.ne.jp>
2-3-28 Tsurumaki-minami, Hadano
Tel +81 463 69 1922
Fax +81 463 69 1922
More information about the R-help