Description Usage Arguments Value References See Also Examples
Tuning function for finding the number of groups to select for an sgspls object. Function is consistent in the sparsity parameters but may be tuned over the number of groups.
1 2 | tune_groups(parameters, group_seq = NULL, block = "X", folds = 10,
scale_resp = TRUE, setseed = 1)
|
parameters |
List of parameters to use in the current PLS object (see examples below). |
group_seq |
a vector containing the number of groups to tune over. |
block |
A string either "X" or "Y" to indicate which block to tune parameters over. |
folds |
The number of folds to use in cross validation. |
scale_resp |
Logical, the MSEP is standardised across responses (see perf function for details). |
setseed |
False, or integer for replicating tuning parameters. |
tune_groups
returns a list with class cv.sgspls
with measures:
result_tuning |
A matrix containing the tuning parameters and MSEP values. |
best |
A vector containing the optimal tuning parameters. |
parameters |
A list of the parameters for a sgspls object. |
tuning_sparsities |
A matrix of group, subgroup and individual sparsities tuned over. |
folds |
Number of folds used in cross validation. |
min_cv |
Minimum MSEP score. |
group_seq |
Groups tuned over in cross validation. |
Liquet Benoit, Lafaye de Micheaux, Boris Hejblum, Rodolphe Thiebaut. A group and Sparse Group Partial Least Square approach applied in Genomics context. Submitted.
sgspls
Tuning functions calc_pve
, tune_sgspls
.
Model performance and estimation predict.sgspls
, perf.sgspls
, coef.sgspls
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 | set.seed(1)
n = 50; p = 510;
size.groups = 30; size.subgroups = 5
groupX <- ceiling(1:p / size.groups)
subgroupX <- ceiling(1:p / size.subgroups)
X = matrix(rnorm(n * p), ncol = p, nrow = n)
beta <- rep(0,p)
bSG <- -2:2; b0 <- rep(0,length(bSG))
betaG <- c(bSG, b0, bSG, b0, bSG, b0)
beta[1:size.groups] <- betaG
y = X %*% beta + rnorm(n)
#--------------------------------------#
#-- Set up a basic model to tune --#
cv_pls <- list(X=X, Y=y, groupX=groupX, subgroupX=subgroupX, ncomp = 1:3)
cv_pls_comp1 <- tune_groups(parameters = cv_pls, group_seq = 1:2, scale_resp = FALSE)
#-- MSEP is on the original scale for the response --#
cv_pls_comp1$MSEP
cv_pls_comp1$keep_opt
cv_pls_comp1$ncomp_opt
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.