[R] X-fold cross validation function for discriminant analysis

Weiwei Shi helprhelp at gmail.com
Thu Nov 16 17:45:52 CET 2006


Hi, Wade:
Some functions in R have n-fold cv themselves. For example, if you are
looking for a linear discriminant analysis (lda {MASS}), it comes with
a "leave-one-out" cv in which n equals the size of training sample,
and it gives you pretty good estimation of error rate. But be advised,
this estimated error still comes from training data, which sometimes
(in case of overfitting or condition differences b/w training and
prediction) are much bigger than the error rates in your future data.

BTW, if you are using randomForest, then it uses a out-of-bag (OOB)
method to esitmate the prediciton error.

HTH,

Weiwei

On 11/16/06, Wade Wall <wade.wall at gmail.com> wrote:
> Hi all,
>
> I ran a discriminant analysis with some data and want to get a general idea
> of prediction error rate.  Some have suggested using X-fold cross validation
> procedure.  Anyone know if there is a function for this in R?
>
> Thanks,
>
> Wade
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>


-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III



More information about the R-help mailing list