bootPLS, using bootstrap to find hyperparameters for Partial Least Squares Regression models and their extensions
Frédéric Bertrand, Jeremy Magnanensi and Myriam Maumy-Bertrand
https://doi.org/10.32614/CRAN.package.bootPLS
The goal of bootPLS is to provide several non-parametric stable bootstrap-based techniques to determine the numbers of components in Partial Least Squares and sparse Partial Least Squares linear or generalized linear regression.
bootPLS implements several algorithms that were published as a book chapter and two articles.
-
A new bootstrap-based stopping criterion in PLS component construction, J. Magnanensi, M. Maumy-Bertrand, N. Meyer and F. Bertrand (2016), in The Multiple Facets of Partial Least Squares and Related Methods. doi:10.1007/978-3-319-40643-5_18.
-
A new universal resample-stable bootstrap-based stopping criterion for PLS component construction, J. Magnanensi, F. Bertrand, M. Maumy-Bertrand and N. Meyer, (2017), Statistics and Computing, 27, 757–774. doi:10.1007/s11222-016-9651-4.
-
New developments in Sparse PLS regression, J. Magnanensi, M. Maumy-Bertrand, N. Meyer and F. Bertrand, (2021), Frontiers in Applied Mathematics and Statistics. doi:10.3389/fams.2021.693126.
Support for parallel computation and GPU is being developed.
This website and these examples were created by F. Bertrand and M. Maumy-Bertrand.
Installation
You can install the released version of bootPLS from CRAN with:
install.packages("bootPLS")You can install the development version of bootPLS from github with:
devtools::install_github("fbertran/bootPLS")
Pine real dataset: pls and spls regressions
Loading and displaying dataset
Load and display the pinewood worm dataset.
library(bootPLS) library(plsRglm) data(pine, package = "plsRglm") Xpine<-pine[,1:10] ypine<-log(pine[,11])
pairs(pine)Michel Tenenhaus' reported in his book, La régression PLS (1998) Technip, Paris, that most of the expert biologists claimed that this dataset features two latent variables, which is tantamount to the PLS model having two components.
PLS LOO and CV
Leave one out CV (K=nrow(pine)) one time (NK=1).
bbb <- plsRglm::cv.plsR(log(x11)~.,data=pine,nt=6,K=nrow(pine),NK=1,verbose=FALSE) plsRglm::cvtable(summary(bbb)) #> ____************************************************____ #> ____Component____ 1 ____ #> ____Component____ 2 ____ #> ____Component____ 3 ____ #> ____Component____ 4 ____ #> ____Component____ 5 ____ #> ____Component____ 6 ____ #> ____Predicting X without NA neither in X nor in Y____ #> Loading required namespace: plsdof #> Error in loadNamespace(x): there is no package called 'plsdof'
Set up 6-fold CV (K=6), 100 times (NK=100), and use random=TRUE to randomly create folds for repeated CV.
bbb2 <- plsRglm::cv.plsR(log(x11)~.,data=pine,nt=6,K=6,NK=100,verbose=FALSE)
Display the results of the cross-validation.
plsRglm::cvtable(summary(bbb2)) #> ____************************************************____ #> ____Component____ 1 ____ #> ____Component____ 2 ____ #> ____Component____ 3 ____ #> ____Component____ 4 ____ #> ____Component____ 5 ____ #> ____Component____ 6 ____ #> ____Predicting X without NA neither in X nor in Y____ #> Loading required namespace: plsdof #> Error in loadNamespace(x): there is no package called 'plsdof'
The
