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 ? ?
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. >[[alternative HTML version deleted]]
Data set attached ?
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
Data set attached ? rename to mydata.csv .
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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mydata.txt
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20160303/ccd95af7/attachment-0001.txt>