# NOT RUN {
data(MSC)
X=MSC$X
Y=MSC$Y
boot1=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5)
boot2=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5,showProgress=FALSE)
boot3=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5,showProgress=FALSE, cpus=2)
# construct a list of bootsPLS object
bootsPLS.object=list(boot1,boot2,boot3)
# compile the outputs in one bootsPLS object
boot=compile.bootsPLS.object(bootsPLS.object)
# fit the model
fit=fit.model(boot,auto.tune=TRUE) #tuning number of components and variables
fit=fit.model(boot,ncomp=2) #tuning number of variables on the 2components
plotIndiv(fit,ind.names=FALSE, legend=TRUE)
# prediction and Confidence Interval, here we use the same dataset but it should be external data
pred=prediction(fit,X.test=X,CI=TRUE)
head(pred$Y.hat.test[,,"comp.1"])
lapply(pred$out.CI$CI$'comp.1',head)
# }
Run the code above in your browser using DataLab