# NOT RUN {
data(MSC)
X=MSC$X
Y=MSC$Y
# with a bootsPLS object
boot=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5)
fit=fit.model(boot,ncomp=3)
CI=CI.prediction(fit,X.test=X)
plot(CI)
pred=prediction(fit,X.test=X, CI=TRUE)
plot(pred$out.CI, ncomp=2)
# we color each confidence interval by the predicted class
plot(pred$out.CI, ncomp=2,
col = color.mixo(factor(pred$predicted.test$"max.dist"[,2]))) #second component
# because bootsPLS was used with dist="max.dist" (by default)
# and because there are only two levels in the outcome,
# everything above the 0.5 line is predicted as MSC
par(mfrow=c(3,1))
plot(pred$out.CI, ncomp=1, level="MSC")
plot(pred$out.CI, ncomp=2, level="MSC")
plot(pred$out.CI, ncomp=3, level="MSC")
#we can do the same things for the second level (Non-MSC)
par(mfrow=c(3,1))
plot(pred$out.CI, ncomp=1, level="Non-MSC")
plot(pred$out.CI, ncomp=2, level="Non-MSC")
plot(pred$out.CI, ncomp=3, level="Non-MSC")
# }
Run the code above in your browser using DataLab