plsrauto: PLS regressions under different combinations of X-variable...

Description Usage Arguments Details Value References See Also Examples

Description

The function plsrauto performs the partial least squares (PLS) regressions under different combinations of X-variable range and preprocessing method automatically.

Usage

1
2
3
4
plsrauto(formula = NULL, data = NULL, testdata = NULL, yTrain = NULL,
  xTrain = NULL, xTest = NULL, yTest = NULL, yname = NULL,
  xrange = NULL, p = 2, n = 11, maxcomp = 10, plot = FALSE,
  output = FALSE, ...)

Arguments

formula

a model formula like y ~ x. See plsr for a detailed description.

data

an optional data frame with the data to fit the model from.

testdata

data set for prediction.

xrange

an object of class list which contains ranges of X-variables (see below).

p

filter order for Savitzky-Golay smoothing (default value is 2).

n

filter length (window size) for Savitzky-Golay smoothing (must be odd. default value is 11).

output

if TRUE, the results are output as PDF and CSV files in the 'PLSR_auto' directory.

...

additional arguments passed to plsr in 'pls' package.

Details

Three steps of preprocessing are automatically applied to the X-variable data set. First, standard normal variate (SNV) is applied or not. Second, Savitzky-Golay smoothing, 1st derivative or 2nd derivative is applied or not, respectively. Finally, auto-scaling is applied or not. Total 16 (2*4*2) kinds of preprocessing methods are applied and the results of PLS regression are returned as an object of class data.frame. If output == TRUE, each PLS regression result is output as PDF and CSV files in one directory.

Value

an object of class data.frame containing the statistics of PLS regressions under the different combinations of X-variable range and preprocessing method is returned.

References

Vignette https://www.gitbook.com/book/uwadaira/plsropt_vignette_ver1-2-0

See Also

plsrPlot, plsr

Examples

1
2
3
4
data(peach)
datTrain <- peach[1:50, ]
datTest  <- peach[51:74, ]
result.all <- plsrauto(Brix ~ NIR, data = datTrain, testdata = datTest, xrange = list(c(700, 1098), c(1100, 2498)))

uwadaira/plsropt documentation built on May 3, 2019, 2:39 p.m.