if (FALSE) {
## between 5~15 seconds
# load plsgenomics library
library(plsgenomics)
# load leukemia data
data(leukemia)
# Determine the best number of components to be used for classification using the
# cross-validation procedure
# choose the best number from 2,3,4
pls.lda.cv(Xtrain=leukemia$X,Ytrain=leukemia$Y,ncomp=2:4,nruncv=20)
# choose the best number from 1,2,3
pls.lda.cv(Xtrain=leukemia$X,Ytrain=leukemia$Y,ncomp=3,nruncv=20)
}
Run the code above in your browser using DataLab