powered by
Ensemble sparse partial least squares regression.
enspls.fit( 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 )
A list containing all sparse partial least squares model objects.
Predictor matrix.
Response vector.
Maximum number of components included within each model. If not specified, will use 5 by default.
5
Number of cross-validation folds used in each model for automatic parameter selection, default is 5.
Parameter (grid) controlling sparsity of the model. If not specified, default is seq(0.2, 0.8, 0.2).
seq(0.2, 0.8, 0.2)
Number of models to build with Monte-Carlo resampling or bootstrapping.
Resampling method. "mc" (Monte-Carlo resampling) or "boot" (bootstrapping). Default is "mc".
"mc"
"boot"
Sampling ratio used when method = "mc".
method = "mc"
Integer. Number of CPU cores to use. Default is 1 (not parallelized).
1
Nan Xiao <https://nanx.me>
See enspls.fs for measuring feature importance with ensemble sparse partial least squares regressions. See enspls.od for outlier detection with ensemble sparse partial least squares regressions.
enspls.fs
enspls.od
data("logd1k") x <- logd1k$x y <- logd1k$y set.seed(42) fit <- enspls.fit( x, y, reptimes = 5, maxcomp = 3, alpha = c(0.3, 0.6, 0.9) ) print(fit) predict(fit, newx = x)
Run the code above in your browser using DataLab