[R] Help on NNET

Thomas W Blackwell tblackw at umich.edu
Thu Jul 17 16:25:21 CEST 2003


I'm not a nnet() user, but after reading the help, there are
two things you might try, both in the model formula passed to
nnet() in the third line of code below.  Alternate version:

pupil.nn2 <- nnet( as.factor(Type) ~ X1 + X2, ...
	 	(with all the remaining arguments as before).

I'm not sure which (if either) of these two variants might do
the trick.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Thu, 17 Jul 2003, sbinny wrote:

> The following is the script:
>
> read.csv('pupil.txt',header=TRUE,sep='\t')->pupil
> samp<-c(1:50, 112:162, 171:220, 228:278)
> pupil.nn2 <- nnet(Type ~ ., data = pupil, subset = samp, size = 2, rang = 0.1, decay = 5e-4, maxit = 200)
> table(pupil$Type[-samp], predict(pupil.nn2, pupil[-samp,], type = "class"))
>
> There are totally 351 observations.
> My objective is to classify them into 4 classes.
>
> Thanks a lot for your help!




More information about the R-help mailing list