enspls.od: Ensemble Sparse Partial Least Squares for Outlier Detection

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

View source: R/enspls.od.R

Description

Outlier detection with ensemble sparse partial least squares.

Usage

1
2
enspls.od(x, y, maxcomp = 5L, cvfolds = 5L, alpha = seq(0.2, 0.8, 0.2),
  reptimes = 500L, method = c("mc", "boot"), ratio = 0.8, parallel = 1L)

Arguments

x

Predictor matrix.

y

Response vector.

maxcomp

Maximum number of components included within each model. If not specified, will use 5 by default.

cvfolds

Number of cross-validation folds used in each model for automatic parameter selection, default is 5.

alpha

Parameter (grid) controlling sparsity of the model. If not specified, default is seq(0.2, 0.8, 0.2).

reptimes

Number of models to build with Monte-Carlo resampling or bootstrapping.

method

Resampling method. "mc" (Monte-Carlo resampling) or "boot" (bootstrapping). Default is "mc".

ratio

Sampling ratio used when method = "mc".

parallel

Integer. Number of CPU cores to use. Default is 1 (not parallelized).

Value

A list containing four components:

  • error.mean - error mean for all samples (absolute value)

  • error.median - error median for all samples

  • error.sd - error sd for all samples

  • predict.error.matrix - the original prediction error matrix

Note

To maximize the probablity that each observation can be selected in the test set (thus the prediction uncertainty can be measured), please try setting a large reptimes.

Author(s)

Nan Xiao <https://nanx.me>

See Also

See enspls.fs for measuring feature importance with ensemble sparse partial least squares regressions. See enspls.fit for fitting ensemble sparse partial least squares regression models.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("logd1k")
x = logd1k$x
y = logd1k$y

set.seed(42)
od = enspls.od(
  x, y, reptimes = 5, maxcomp = 3,
  alpha = c(0.3, 0.6, 0.9))
plot(od, prob = 0.1)
plot(od, criterion = "sd", sdtimes = 1)

enpls documentation built on May 19, 2017, 2:29 p.m.

Search within the enpls package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.