powered by
Compute information criteria for component selection
pls_information_criteria(object, X, Y, max_comp = NULL)
A data frame with RSS, RMSE, AIC and BIC per component.
A fitted PLS model.
Training design matrix.
Training response matrix or vector.
Maximum number of components to consider.
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_information_criteria(fit, X, y)
Run the code above in your browser using DataLab