if (FALSE) {
## between 5~15 seconds
# load plsgenomics library
library(plsgenomics)
# load Ecoli data
data(Ecoli)
# determine the best number of components for PLS regression using the cross-validation approach
# choose the best number from 1,2,3,4
pls.regression.cv(Xtrain=Ecoli$CONNECdata,Ytrain=Ecoli$GEdata,ncomp=4,nruncv=20)
# choose the best number from 2,3
pls.regression.cv(Xtrain=Ecoli$CONNECdata,Ytrain=Ecoli$GEdata,ncomp=c(2,3),nruncv=20)
}
Run the code above in your browser using DataLab