Description Usage Arguments Details Value Author(s) See Also Examples

Finds the optimal number of component for one of the three extesions of LS-PLS. Moreover it finds the `lambda`

optimal for the R-LS-PLS method.

1 2 3 |

`Y` |
a vector of length |

`X` |
a data matrix ( |

`D` |
a data matrix ( |

`ncompmax` |
a positive integer. |

`folds` |
a positive integer indicating the number of folds in K-folds cross-validation procedure. |

`proportion` |
proportion of the dataset in the learning sample. |

`method` |
one of the three extensions of LS-PLS for logistic regression models (LS-PLS-IRLS, R-LS-PLS, IR-LS-PLS). |

`lambda.grid` |
vector of positif real (grid for ridge parameter). To use only if |

`penalized` |
if TRUE the parameter associated with D is ridge penalized. To use only if |

`nbrIterMax` |
maximal number of iterations. To use only if |

`threshold` |
used for the stopping rule. To use only if |

This function finds the optimal number of component and the optimal lambda for a LS-PLS regression. At each cross validation run, `X`

, `D`

and `Y`

are split into one training set and one test set (of proportion `proportion`

and `1-proportion`

). Then for each component between 1 and `ncompmax`

(and for each value of `lambda.grid`

if `method`

equals to R-LS-PLS) classification error rate is determined. At the end we choose the `lambda`

and the `ncomp`

for which the classification error rate is minimal. This function returns also `p.cvg`

. It's a vector of size `ncompmax`

which contains convergence proportion for each number of component between 1 and `ncompmax`

. For the method R-LS-PLS, p.cvg is a matrix of size `ncompmax x length(lambda.grid`

).

`ncompopt ` |
the optimal number of component. |

`lambdaopt ` |
lambda optimal. |

`p.cvg ` |
convergence proportion. |

Caroline Bazzoli, Thomas Bouleau, Sophie Lambert-Lacroix

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
#data
data(BreastCancer)
#vector of responses
Y<-BreastCancer$Y
#Genetic data
X<-BreastCancer$X
#Clinical data
D<-BreastCancer$D
#SIS selection
X<-scale(X)
X<-SIS.selection(X=X,Y=Y,pred=50)
#Cross validation, 90% of our datasets is used to compose learning samples
#method LS-PLS-IRLS
ncompopt.lsplsirls<-cv.lspls.glm(Y=Y,X=X,D=D,folds=5,ncompmax=5,proportion=0.9,
method="LS-PLS-IRLS")$ncompopt
#method R-LS-PLS
cv<-cv.lspls.glm(Y=Y,X=X,D=D,ncompmax=5,proportion=0.9,method="R-LS-PLS",
lambda.grid=exp(log(10^seq(-3,2,0.7))),
penalized=TRUE,nbrIterMax=15,
threshold=10^(-12))
ncompopt.rlspls<-cv$ncompopt
lambdaopt.rlspls<-cv$lambdaopt
#method IR-LS-PLS
ncompopt.irlspls<-cv.lspls.glm(Y=Y,X=X,D=D,ncompmax=5,proportion=0.9,method="IR-LS-PLS",
nbrIterMax=15,threshold=10^(-12))$ncompopt
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.