trainPLS: Train PLS for train dataset by cross-validation

Description Usage Arguments Examples

Description

Train PLS for train dataset by cross-validation. The preprocessing method will be optimized automatically. However, the number of latent variables has to be determined manually. Planning to add variable reduction in the future.

Usage

1
2
3
4
trainPLS(x, y, maxncomp = 20, cvsegments = 10, round = 2,
  reduceVar = FALSE, cycles = 1, ncomp = c("auto", "manual", "fixed"),
  fixedncomp = NULL, threshold = 0.02, saveAllModel = FALSE,
  plotting = TRUE)

Arguments

x

predictor matrix

y

prediction target vector

maxncomp

maximum ncomp for calculation

cvsegments

refer to mvrCv's segments argument

round

round numbers

reduceVar

variable reduction using VIP

cycles

cycles for variable reduction

ncomp

'auto','manual' or 'fixed'

fixedncomp

fixed numerical value

threshold

threshold for selecting ncomp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(EEM)
data(gluten)
gluten_uf <- unfold(gluten) # unfold list into matrix

# delete columns with NA values
index <- colSums(is.na(gluten_uf)) == 0
gluten_uf <- gluten_uf[, index]
gluten_ratio <- as.numeric(names(gluten))

result <- trainPLS(gluten_uf, gluten_ratio) 
result

chengvt/cheng documentation built on May 13, 2019, 3:52 p.m.