cvOPLSDA: K-fold cross-validation for OPLS-DA.

Description Usage Arguments Value Examples

View source: R/OPLSDA.R

Description

K-fold cross-validation for OPLS-DA based on the RMSE criterion and stratified according to y.

Usage

1
cvOPLSDA(x, y, k_fold = 10, NumOrtho = 1, ImpG = FALSE)

Arguments

x

A data matrix on which will be based the analysis.

y

A numerical vector representing the class of individuals.

k_fold

The number of sub-datasets to create for cross-validation.

NumOrtho

The maximum number of orthogonal components allowed in OPLSDA.

ImpG

If TRUE, prints a validation plot.

Value

A list with the following elements:

RMSECV

RMSECV from the OPLSDA cross-validation.

folds_i

A vector indicating the group of observations for cross-validation.

Prop1

Table of proportions of 1's in y for each subgroup.

yres

List with true and predicted classes for each NumOrtho.

Examples

1
2
3
4
5
data('DataSimul')
x = DataSimul[['x']]
y = DataSimul[['y']]
cvOPLSDA.res = cvOPLSDA(x = x, y = y, k_fold = 10, NumOrtho = 5)
plot(cvOPLSDA.res$RMSECV)

ManonMartin/MBXUCL documentation built on Nov. 26, 2021, 8:45 p.m.