This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cross Validation In R

I want to perform regression methods such as LDA, QDA, logistic and bayesian model averaging on the Australian data in R. How can I do cross validation in R for this data ?

Sorry, "the Australian data"? I assume you mean the sample dataset, data(austres). Sounds like you're learning R and this is not a bioinformatics question.

Do people earn points for closing questions? Cross-validation is an important topic in bioinformatics and thus questions and answers with content on cross validation are relevant to bioinformatics. The question may be asked poorly, but the answerers could fill in the gap if desired, and the questioner could be prompted for better question posing. I don't understand how cross-validation is off-topic for bioinformatics.

2 answers

You split up your dataset into non-overlapping folds, e.g. randomly or stratified. This should be easily doable with R. Then you train your model on one part and test on the rest. In e.g. 10-fold CV you essentially rotate your folds, i.e. 9/10 of the set is used as train- the rest 1/10 as test set. Obviously this could be done 10 times.

try caret library for R - it's include crossvalidation options by default and coupled with different learning algorithms

Log in to answer this question.