A vector of factors giving the class assignments for the
samples to be used in the crossvalidation.
X
A matrix with samples in rows and observations in
columns. Note that this is different than the usual paradigm for
microarray data.
method
One of "pls", "pcr", "ridge", corresponding to partial
least squares, principal components regression and ridge regression.
Value
A vector of factors giving the predicted class assignments for each of
the samples in the training set. A confusion matrix can be constructed
using confusion.
Details
This function performs a leave one out crossvalidation, which can be
used to estimate the accuracy of a classifier. Each sample is removed
in turn and a classifier is built using the remaining samples. The
class of the removed sample is then predicted using the
classifier. This is repeated for each sample, resulting in a vector of
predicted class assignments for each sample in the original training
set.
Although far from perfect, this method can be used to estimate the
accuracy of a given classifier without splitting data into a training
and testing set.