Felix Bach
2011-May-27 09:55 UTC
[R] errorest of library iprde: specifiying parameters for regularized DA
Hi dear R users, I am using the function errorest from the libbrary ipred to estimate the 10 fold and bootstrap classification error rate using regularized discriminat function analysis (functiopn rda from library klaR). Is it possible to set my own values for gamma and lambda? Any help will be highly appreciated! Best wishes, Felix library(klaR) library(ipred) # force predict to return class labels only mypredict.lda <- function(object, newdata) predict(object, newdata = newdata)$class # 10-fold cv of RDA for Iris data errorest(Species ~ ., data=iris, model=rda, estimator = "cv", predict= mypredict.lda) --
Uwe Ligges
2011-May-27 13:10 UTC
[R] errorest of library iprde: specifiying parameters for regularized DA
On 27.05.2011 11:55, Felix Bach wrote:> Hi dear R users, > > I am using the function errorest from the libbrary ipred to estimate the 10 fold and bootstrap classification error rate using regularized discriminat function analysis (functiopn rda from library klaR). Is it possible to set my own values for gamma and lambda? > Any help will be highly appreciated! > > Best wishes, > > Felix > > library(klaR) > library(ipred) > > # force predict to return class labels only > mypredict.lda<- function(object, newdata) predict(object, newdata = newdata)$class > > # 10-fold cv of RDA for Iris data > errorest(Species ~ ., data=iris, model=rda, estimator = "cv", predict= mypredict.lda)Yes, via ... as in: errorest(Species ~ ., data=iris, model=rda, estimator = "cv", predict= mypredict.lda, gamma=0, lambda=0) Uwe Ligges> -- > > ______________________________________________ > R-help at 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.