pls.cv: The Cross-Validation of Classification and Regression models...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/1102-PLS.R

Description

The Cross-Validation of Classification and Regression models using Partial Least Squares

Usage

1
pls.cv(xtr, ytr, cv.fold = 5, maxcomp = NULL)

Arguments

xtr

A data frame or a matrix of predictors.

ytr

A response vector. If a factor, classification is assumed, otherwise regression is assumed.

cv.fold

The fold, the defalut is 5.

maxcomp

Maximum number of components included within the models, if not specified, default is the variable (column) numbers in x.

Details

This function performs k-fold cross validation for partial least squares regression and classification.

Value

the retrun a list containing four components:

Author(s)

Min-feng Zhu <wind2zhu@163.com>

See Also

See rf.cv for the Cross-Validation of Classification and Regression models using Random Forest

Examples

1
2
3
4
training = read.csv(system.file('sysdata/training2.csv', package = 'BioMedR'), header = TRUE)
y = training[, 1]
x = training[, -1]
pls.tr <- pls.cv(x, y)

wind22zhu/BioMedR documentation built on Oct. 21, 2019, 12:51 p.m.