Skip to content
Prev 313568 / 398502 Next

neural net

Hi
Thanks for your reply. I have compared my data with some other which works and I cannot see the difference... 

The structure of my data is shown below:
'data.frame':   19 obs. of  7 variables: 
 $ drug    : Factor w/ 19 levels "A","B","C","D",..: 1 2 3 4 5 6 7 8 9 10 ... 
 $ param1  : int  111 347 335 477 863 737 390 209 376 262 ... 
 $ param2 : int  15 13 9 37 24 28 63 93 72 16 ... 
 $ param3     : int  125 280 119 75 180 150 167 200 201 205 ... 
 $ param4     : int  40 55 89 2 10 15 12 48 45 49 ... 
 $ param5     : num  0.5 3 -40 0 5 6 0 45 -60 25 ... 
 $ Class   : int  1 2 1 1 2 2 3 3 3 3 ...
drug        param1         param2         param3             param4              param5             Class       
 A      : 1   Min.   :111.0   Min.   : 2.0   Min.   : 75.0   Min.   :-20.00   Min.   :-60.000   Min.   :1.000   
 B      : 1   1st Qu.:253.5   1st Qu.:15.0   1st Qu.:132.5   1st Qu.: 12.00   1st Qu.:  0.000   1st Qu.:1.000   
 C      : 1   Median :335.0   Median :28.0   Median :164.0   Median : 40.00   Median :  6.000   Median :2.000   
 D      : 1   Mean   :383.0   Mean   :33.0   Mean   :166.0   Mean   : 35.26   Mean   :  4.447   Mean   :1.895   
 E      : 1   3rd Qu.:433.5   3rd Qu.:42.5   3rd Qu.:200.5   3rd Qu.: 54.00   3rd Qu.: 20.500   3rd Qu.:2.000   
 F      : 1   Max.   :863.0   Max.   :93.0   Max.   :280.0   Max.   : 89.00   Max.   : 45.000   Max.   :3.000   
 (Other):13                                                             

The structure of the example data which worked is shown below:
'data.frame':   248 obs. of  8 variables: 
 $ education     : Factor w/ 3 levels "0-5yrs","6-11yrs",..: 1 1 1 1 2 2 2 2 2 2 ... 
 $ age           : num  26 42 39 34 35 36 23 32 21 28 ... 
 $ parity        : num  6 1 6 4 3 4 1 2 1 2 ... 
 $ induced       : num  1 1 2 2 1 2 0 0 0 0 ... 
 $ case          : num  1 1 1 1 1 1 1 1 1 1 ... 
 $ spontaneous   : num  2 0 0 0 1 1 0 0 1 0 ... 
 $ stratum       : int  1 2 3 4 5 6 7 8 9 10 ... 
 $ pooled.stratum: num  3 1 4 2 32 36 6 22 5 19 ...
education        age            parity         induced            case         spontaneous        stratum      pooled.stratum 
 0-5yrs : 12   Min.   :21.00   Min.   :1.000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   : 1.00   Min.   : 1.00   
 6-11yrs:120   1st Qu.:28.00   1st Qu.:1.000   1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:21.00   1st Qu.:19.00   
 12+ yrs:116   Median :31.00   Median :2.000   Median :0.0000   Median :0.0000   Median :0.0000   Median :42.00   Median :36.00   
               Mean   :31.50   Mean   :2.093   Mean   :0.5726   Mean   :0.3347   Mean   :0.5766   Mean   :41.87   Mean   :33.58   
               3rd Qu.:35.25   3rd Qu.:3.000   3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:62.25   3rd Qu.:48.25   
               Max.   :44.00   Max.   :6.000   Max.   :2.0000   Max.   :1.0000   Max.   :2.0000   Max.   :83.00   Max.   :63.00   

So still not sure how to solve the problem .... 






_________
From: PIKAL Petr [petr.pikal at precheza.cz]
Sent: 13 December 2012 07:16
To: dada; r-help at r-project.org
Subject: RE: [R] neural net

Hi
This is not very wise. It changes all numeric values to character. From documentation and your data frame there is nothing obviously wrong. However you did not provide info about structure of your data something like

summary(mydata) or str(mydata).

Documentation does not say much about how neuralnet reacts e.g. on NA values. The best way how to proceed seems to try recommended data and compare them to your data to see where are the differences.

Or you can read sources to see where the error message originates.

Regards
Petr
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.