x_CCA: Sparse Canonical Correlation Analysis (CCA)

View source: R/x_CCA.R

x_CCAR Documentation

Sparse Canonical Correlation Analysis (CCA)

Description

Run a sparse Canonical Correlation Analysis using the PMA package

Usage

x_CCA(
  x,
  z,
  x.test = NULL,
  z.test = NULL,
  y = NULL,
  outcome = NULL,
  k = 3,
  niter = 20,
  nperms = 50,
  permute.niter = 15,
  typex = "standard",
  typez = "standard",
  penaltyx = NULL,
  penaltyz = NULL,
  standardize = TRUE,
  upos = FALSE,
  vpos = FALSE,
  verbose = TRUE,
  n.cores = rtCores,
  outdir = NULL,
  save.mod = ifelse(!is.null(outdir), TRUE, FALSE),
  ...
)

Arguments

x

Matrix: Training x dataset

z

Matrix: Training z dataset

x.test

Matrix (Optional): Testing x set

z.test

Matrix (Optional): Testing z set

y

Outcome vector (Optional): If supplied, linear combinations of x and z need to be additionaly correlated with this

outcome

Character: Type of outcome y: "survival", "multiclass", "quantitative"

k

Integer: Number of components

niter

Integer: Number of iterations

nperms

Integer: Number of permutations to run with CCA.permute The higher, the better.

permute.niter

Integer: Number of iterations to run for each permutation with CCA.permute

typex

Character: "standard", "ordered". Use "standard" if columns of x are unordered; lasso penalty is applied to enforce sparsity. Otherwise, use "ordered"; fused lasso penalty is applied, to enforce both sparsity and smoothness.

typez

Character: "standard", "ordered". Same as typex for z dataset

penaltyx

Float: The penalty to be applied to the matrix x, i.e. the penalty that results in the canonical vector u. If typex is "standard" then the L1 bound on u is penaltyx*sqrt(ncol(x)). In this case penaltyx must be between 0 and 1 (larger L1 bound corresponds to less penalization). If "ordered" then it's the fused lasso penalty lambda, which must be non-negative (larger lambda corresponds to more penalization).

penaltyz

Float: The penalty to be applied to the matrix z, i.e. the penalty that results in the canonical vector v. If typez is "standard" then the L1 bound on v is penaltyz*sqrt(ncol(z)). In this case penaltyz must be between 0 and 1 (larger L1 bound corresponds to less penalization). If "ordered" then it's the fused lasso penalty lambda, which must be non-negative (larger lambda corresponds to more penalization).

standardize

Logical: If TRUE, center and scale columns of x and z

upos

Logical: Require elements of u to be positive

vpos

Logical: Require elements of v to be positive

verbose

Logical: Print messages, including trace from x_CCA.permute and PMA::CCA

n.cores

Integer: Number of cores to use

outdir

Path to output directory. Default = NULL

save.mod

Logical: If TRUE, and outdir is defined, will save trained CCA model to outdir. Default = TRUE if outdir is set, otherwise FALSE

...

Additional arguments to be passed to PMA::CCA

Details

#' x_CCA runs PMA::CCA. If penaltyx is NULL, penaltyx and penaltyz will be estimated automatically using x_CCA.permute (adapted to run in parallel)

Author(s)

E.D. Gennatas

See Also

Other Cross-Decomposition: xselect_decom()


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.