o2cv {o2plsda}R Documentation

Cross validation for O2PLS

Description

Cross validation for O2PLS

Usage

o2cv(
  X,
  Y,
  nc,
  nx,
  ny,
  group = NULL,
  nr_folds = 5,
  ncores = 1,
  scale = FALSE,
  center = FALSE
)

Arguments

X

a Numeric matrix (input)

Y

a Numeric matrix (input)

nc

Integer. Number of joint PLS components.

nx

Integer. Number of orthogonal components in X

ny

Integer. Number of orthogonal components in Y

group

a vector to indicate the group for Y

nr_folds

Integer to indicate the folds for cross validation

ncores

Integer. Number of CPUs to use for cross validation

scale

boolean values determining if data should be scaled or not

center

boolean values determining if data should be centered or not

Value

a data frame with the Q and RMSE values

Author(s)

Kai Guo

Examples

set.seed(123)
X = matrix(rnorm(500),50,10)
Y = matrix(rnorm(500),50,10)
X = scale(X, scale = TRUE)
Y = scale(Y, scale = TRUE)
# group factor could be omitted if you don't have any group 
group <- rep(c("Ctrl","Treat"), each = 25)
cv <- o2cv(X, Y, 1:2, 1:2, 1:2, group=group, nr_folds = 2, ncores=1)

[Package o2plsda version 0.0.25 Index]