Description Usage Arguments Value References See Also Examples
Apply PLS-DA to a matrix or poplin object. It performs standard PLS for classification using the plsr function from the pls package.
1 2 3 4 5 | ## S4 method for signature 'matrix'
reduce_plsda(x, y, ncomp = 2, center = TRUE, scale = FALSE, ...)
## S4 method for signature 'poplin'
reduce_plsda(x, xin, xout, y, ncomp = 2, center = TRUE, scale = FALSE, ...)
|
x |
A matrix or poplin object. |
y |
A factor vector for discrete outcome. |
ncomp |
output dimensionality. |
center |
Logical indicating mean-centering prior to PLS-DA. |
scale |
Logical indicating unit variance scaling prior to PLS-DA. |
... |
Additional arguments passed to plsr. |
xin |
character specifying the name of data to retrieve from |
xout |
character specifying the name of data to store in |
A poplin.plsda or poplin object with the same number of
rows as ncol(x)
containing the dimension reduction result.
poplin.plsda is a matrix containing custom attributes used to summarize and
visualize the PLS-DA result.
Kristian Hovde Liland, Bjørn-Helge Mevik and Ron Wehrens (2021). pls: Partial Least Squares and Principal Component Regression. R package version 2.8-0. https://CRAN.R-project.org/package=pls
Other data reduction methods:
poplin_reduce()
,
reduce_pca()
,
reduce_tsne()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(faahko_poplin)
if (requireNamespace("pls", quietly = TRUE)) {
## response vector
y <- factor(colData(faahko_poplin)$sample_group, levels = c("WT", "KO"))
## poplin object
out <- reduce_plsda(faahko_poplin, xin = "knn_cyclic", xout = "plsda",
y = y)
summary(poplin_reduced(out, "plsda"))
## matrix
m <- poplin_data(faahko_poplin, "knn_cyclic")
out <- reduce_plsda(m, y = y, ncomp = 3)
summary(out)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.