Select the number of components for complete, imputed, or incomplete-data PLS workflows.
Arguments
- x
Predictor matrix, dataset object, or
misspls_imputationobject.- y
Numeric response vector. This may be omitted when
xalready contains a response.- method
Selection workflow:
"complete","nipals_standard", or"nipals_adaptative".- criterion
Selection criterion:
"Q2-LOO","Q2-10fold","AIC","AIC-DoF","BIC", or"BIC-DoF".- max_ncomp
Maximum number of components to consider.
- seed
Optional random seed used by the cross-validation and imputation aggregation steps.
- folds
Number of cross-validation folds used by
"Q2-10fold".- threshold
Threshold applied to
Q2criteria.
Examples
sim <- simulate_pls_data(n = 25, p = 10, true_ncomp = 2, seed = 1)
select_ncomp(sim$x, sim$y, method = "complete", criterion = "AIC", max_ncomp = 4, seed = 2)
#> Loading required namespace: plsdof
#> selection_method criterion selected_ncomp criterion_value max_ncomp seed
#> 1 complete AIC 4 -23.27543 4 2
#> n_imputations status notes
#> 1 1 ok