[R] nnet problem

Pedro Rodrigues prodrigues at dcc.fc.up.pt
Fri Feb 6 18:36:10 CET 2004

I believe you want to fit a nnet model to predict numeric data.

you can try as follows:

xx <- "Matrix of size INPUTS*EXAMPLESTRAIN"
yy <- "Vector of size EXAMPLESTRAIN"
x1 <- "Matrix of size INPUTS*EXAMPLESTEST"

# fit your model like this
nnetmodel <- nnet(x=xx, y=yy, ....)
# or like this only if dealing with a data.frame
nnetmodel <- nnet(outname ~ in1name + ... inNname, ....)

# here numdata will become a vector of size EXAMPLESTEST.
numdata <- predict(nnetmodel, x1) 

Best Regards


On Fri, 2004-02-06 at 14:36,
optimisation1.stagiaire at lagardere-active.com wrote:
> Hello everybody,
> I want to use the nnet library and my problem is that the algorithm seems
> to accept only class as target when the neural is fiiting. So the output
> when I use predict.nnet is also a class. Is it possible to have numeric
> variable as target ? If yes, what is the syntax ?
> Thank you.
> Cordialement,
> **************************************************************************************************************************************************************
> Attention : le present message et toutes les pieces jointes (le "message") sont confidentiels et etablis a l'attention exclusive du ou des destinataire(s) 
> indique(s). Toute autre diffusion ou utilisation non autorisee est interdite. Si vous recevez ce message par erreur, veuillez immediatement en avertir 
> l'expediteur par e-mail en retour, detruire le message et vous abstenir de toute reference aux informations qui y figurent afin d'eviter les sanctions 
> attachees a la divulgation et a l'utilisation d'informations confidentielles. Les messages electroniques sont susceptibles d'alteration. Lagardere SCA 
> et ses filiales declinent toute responsabilite en cas d'alteration ou de falsification du present message.
> Warning : this e-mail and any files attached (the "e-mail") are confidential and intended solely to the named addressee(s). Any unauthorised dissemination 
> or use is strictly prohibited. If you received this e-mail in error, please immediately notify the sender by reply e-mail and then delete the e-mail from 
> your system. Please do not copy, use or make reference to it for any purpose, or disclose its contents to any person : to do so could expose you to sanctions. 
> E-mails can be altered or falsified. Lagardere SCA and its subsidiary companies shall not be liable for any alteration or falsification on this e-mail.
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

More information about the R-help mailing list