repeat_cv: Repeated cross-validation for sNPLS models

View source: R/sNPLS_fit.R

repeat_cvR Documentation

Repeated cross-validation for sNPLS models

Description

Performs repeated cross-validatiodn and represents results in a plot

Usage

repeat_cv(
  X_npls,
  Y_npls,
  ncomp = 1:3,
  samples = 20,
  keepJ = NULL,
  keepK = NULL,
  threshold_j = c(0, 1),
  threshold_k = c(0, 1),
  nfold = 10,
  times = 30,
  parallel = TRUE,
  method = "sNPLS",
  metric = "RMSE",
  ...
)

Arguments

X_npls

A three-way array containing the predictors.

Y_npls

A matrix containing the response.

ncomp

A vector with the different number of components to test

samples

Number of samples for performing random search in continuous thresholding

keepJ

A vector with the different number of selected variables to test in discrete thresholding

keepK

A vector with the different number of selected 'times' to test in discrete thresholding

threshold_j

Vector with threshold min and max values on Wj. Scaled between [0, 1)

threshold_k

Vector with threshold min and max values on Wk. Scaled between [0, 1)

nfold

Number of folds for the cross-validation

times

Number of repetitions of the cross-validation

parallel

Should the computations be performed in parallel? Set up strategy first with future::plan()

method

Select between sNPLS, sNPLS-SR or sNPLS-VIP

metric

Select between RMSE or AUC (for 0/1 response)

...

Further arguments passed to cv_snpls

Value

A density plot with the results of the cross-validation and an (invisible) data.frame with these results


David-Hervas/sNPLS documentation built on Feb. 1, 2024, 6:30 a.m.