Learn R Programming

bigPLSR (version 0.7.2)

pls_select_components: Component selection via information criteria

Description

Component selection via information criteria

Usage

pls_select_components(
  object,
  X,
  Y,
  criteria = c("aic", "bic"),
  max_comp = NULL
)

Value

A list with the per-component table and the selected components.

Arguments

object

A fitted PLS model.

X

Training design matrix.

Y

Training response matrix or vector.

criteria

Character vector specifying which criteria to compute.

max_comp

Maximum number of components to consider.

Examples

Run this code
set.seed(123)
X <- matrix(rnorm(60), nrow = 20)
y <- X[, 1] - 0.5 * X[, 2] + rnorm(20, sd = 0.1)
fit <- pls_fit(X, y, ncomp = 2, scores = "r")
pls_select_components(fit, X, y)

Run the code above in your browser using DataLab