View source: R/rgcca_stability.R
rgcca_stability | R Documentation |
This function can be used to identify the most stable variables identified as relevant by SGCCA. A Variable Importance in the Projection (VIP) based criterion is used to identify the most stable variables.
rgcca_stability( rgcca_res, keep = vapply(rgcca_res$a, function(x) mean(x != 0), FUN.VALUE = 1), n_boot = 100, n_cores = 1, verbose = TRUE, balanced = TRUE, keep_all_variables = FALSE )
rgcca_res |
A fitted RGCCA object (see |
keep |
numeric vector indicating the proportion of top variables per block. |
n_boot |
Number of bootstrap samples (Default: 100). |
n_cores |
Number of cores for parallelization. |
verbose |
Logical value indicating if the progress of the procedure is reported. |
balanced |
A boolean indicating if a balanced bootstrap procedure is performed or not (default is TRUE). |
keep_all_variables |
A boolean indicating if all variables have to be kept even when some of them have null variance for at least one bootstrap sample (default is FALSE). |
top |
indicator on which variables are ranked. |
keepVar |
indices of the top variables. |
bootstrap |
block-weight vectors for ech bootstrap sample. |
rgcca_res |
an RGCCA object fitted on the most stable variables. |
## Not run: ########################### # stability and bootstrap # ########################### data("ge_cgh_locIGR", package = "gliomaData") blocks <- ge_cgh_locIGR$multiblocks Loc <- factor(ge_cgh_locIGR$y) levels(Loc) <- colnames(ge_cgh_locIGR$multiblocks$y) blocks[[3]] <- Loc fit.sgcca <- rgcca(blocks, sparsity = c(.071, .2, 1), ncomp = c(1, 1, 1), scheme = "centroid", verbose = TRUE, response = 3 ) boot.out <- rgcca_bootstrap(fit.sgcca, n_boot = 100, n_cores = 1) fit.stab <- rgcca_stability(fit.sgcca, keep = sapply(fit.sgcca$a, function(x) mean(x != 0)), n_cores = 1, n_boot = 10, verbose = TRUE ) boot.out <- rgcca_bootstrap( fit.stab, n_boot = 500, n_cores = 1, verbose = FALSE ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.