[R] RSNNS neural network

David Winsemius dwinsemius at comcast.net
Thu Mar 3 21:03:52 CET 2016


> On Mar 3, 2016, at 10:30 AM, jake88 <youtube_b at telus.net> wrote:
> 
> Data set attached …

Perhaps it was, and if you replied-all then it might be in the copy that was sent directly to Charles, but it was not attached after the rhelp mail-server scrubbed it. It wasn't labeled correctly by your email client as MIME-text. Rename it mydata.txt and it will (probably) make it through.

-- 
David.
> 
> require ( RSNNS ) 
> mydata = read.csv("mydata.csv",header = TRUE) 
> 
> mydata.train = mydata[3000:10000,]
> 
> mydata.test = mydata[10005:10006,]
> 
> myfit <- elman ( mydata.train[,2:19],mydata.train[,1], size =100 , learnFuncParams =c (0.1) , maxit =1000)
> 
> pred <-predict (myfit , mydata.test[,2:19])
> 
> 
> 
> 
> 
> From: Charles Determan [mailto:cdetermanjr at gmail.com] 
> Sent: Thursday, March 03, 2016 6:31 AM
> To: jake88
> Cc: r-help
> Subject: Re: [R] RSNNS neural network
> 
> 
> 
> Unfortunately we can only provide so much help without a reproducible example.  Can you use a dataset that everyone would have access to to reproduce the problem?  Otherwise it is difficult for anyone to help you.
> 
> Regards,
> 
> Charles
> 
> 
> 
> On Tue, Mar 1, 2016 at 12:35 AM, jake88 <youtube_b at telus.net> wrote:
> 
> I am new to R and neural networks . So I trained and predicted an elman
> network like so : 
> 
> require ( RSNNS ) 
> mydata = read.csv("mydata.csv",header = TRUE) 
> mydata.train = mydata[1000:2000,] 
> mydata.test = mydata[800:999,] 
> 
> fit <- elman ( mydata.train[,2:10],mydata.train[,1], size =100 
>     learnFuncParams =c (0.1) , maxit =1000) 
> pred <-predict (fit , mydata.test[,2:10]) 
> 
> So pred contains the predictions .
> The problem I am having is that when I run pred <-predict (fit ,
> mydata.test[1,2:10]) repeatedly , it gives me different results each time .
> Should not the weights and bias be set permanently in the network and give
> the same result everytime   ?   
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 
> No virus found in this message.
> Checked by AVG - www.avg.com
> 
> 03/03/16
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list