Partial Least Squares Discriminant Analysis for class prediction.
Arguments
- dataset
A
ls_dataset()object.- grouping
Character. Column name in
sample_infowith class labels.- n_components
Integer. Number of PLS latent variables. Default 5.
- validation
Character.
"CV"(10-fold),"LOO", or"none". Default"CV".
Value
An S3 object of class libs_plsda with elements model,
predictions (tibble with predicted/observed class), confusion_matrix,
accuracy, class_labels, n_components, sample_info.
Examples
ds <- ls_example_data("tissue")
# \donttest{
if (requireNamespace("pls", quietly = TRUE)) {
plsda <- ls_plsda(ds, "tissue", n_components = 3, validation = "none")
plsda$accuracy
}
#> [1] 0.48
# }