Hi Steve, Thanks a lot for your reply.1)Im still confused which equation (1- sqrt(mean(mymodel$MSE)) OR 2- mean(sqrt(mymodel$MSE)) )is equivalent to sqrt(mean(error**2))?I just want to compute the typical RMSE that is usually used for measuring the performance of regression systems. 2)Im talking about another addition related to the svm parameters in the call to SVM. i.e.my_svm_model<- function(myformula, mydata, mytestdata, parameterlist) {mymodel <- svm(myformula, data=mydata, cross=10, cost=parameterlist[[1]], epsilon=parameterlist[[2]],gamma=parameterlist[[3]])If I dont set these parameters of svm (like: my_svm_model<- function(myformula, mydata, mytestdata), how does svm know them? 3) in 2) Is it correct to use mydata instead of data=mydata? Or I can do that only if it is the last argument in the function call? 4)Does mytestdata[,1] means that the model will use only the last column on the testing set?Many thanks,Nancy
> Date: Sat, 2 Jan 2010 17:32:44 -0500 > Subject: Re: [R] Questions bout SVM > From: mailinglist.honey...@gmail.com > To: nancyada...@hotmail.com > CC: r-help@r-project.org > > Hi, > > On Fri, Jan 1, 2010 at 1:03 PM, Nancy Adam <nancyada...@hotmail.com> wrote: > > > > Hi everyone, > > Can someone please help me in these questions?: > > > > 1)if I use crossvalidation with svm, do I have to use this equation to > > calculate RMSE?: > > mymodel <- svm(myformula,data=mydata,cross=10) > > sqrt(mean(mymodel$MSE)) > > No, I don't think so. W/o looking at the C code, I'm guessing that MSE > is a vector of length 10 that represents the mean squared error from > each fold ... but what are you trying to do? Trying to get the average > of the RMSE over all folds? Wouldn't that then be: > mean(sqrt(mymodel$MSE))? > > > But if I dont use crossvalidation, I have to use the following to > > calculate RMSE: > > mymodel <- svm(myformula,data=mydata) > > mytest <- predict(mymodel, mytestdata) > > error <- mytest - mytestdata[,1] > > sqrt(mean(error**2)) > > OK > > > 2)if I dont set the parameters of SVM, like in the above, how the program > > knows them? Or it is a must to determine them when I invoke svm? > > What parameters are you talking about? Your two `svm` function calls > look the same with the exception of not including a value for `cross` > in your 2nd. > > What parameters of the SVM do you think are different? > > > 3)can you please tell me why we use this equation: > > mymodel <- svm(myformula,data=mydata)instead of mymodel <- svm(myformula, > > mydata) > > Since the "data" argument is the 2nd argument in the function > definition of svm.formula, those two invocations are actually the > same. > > > and why use this: > > error <- mytest - mytestdata[,1] instead of error <- mytest mytestdata > > It depends on what type of variable 'mytestdata' is, and its shape, > eg. those two calls might be doing the same thing if mytestdata is > just a 1d matrix. > > -steve > > -- > Steve Lianoglou > Graduate Student: Computational Systems Biology > | Memorial Sloan-Kettering Cancer Center > | Weill Medical College of Cornell University > Contact Info: http://cbio.mskcc.org/~lianos/contact _________________________________________________________________ Keep your friends updatedeven when youre not signed in. [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list 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.