validateMlComb: Validate parameters specific to 'mlComb'

View source: R/validator.R

validateMlCombR Documentation

Validate parameters specific to mlComb

Description

Internal helper used by mlComb to validate machine-learning-specific arguments before fitting the caret model. It checks the selected method, resampling method, resampling control parameters, preprocessing options, bagging parameter, and oob/adaptive resampling restrictions.

Usage

validateMlComb(
  niters = 10,
  nfolds = 5,
  nrepeats = 3,
  preProcess = NULL,
  B = 25,
  p = 0.75,
  resample = "none",
  method = NULL
)

Arguments

niters

A positive integer indicating the number of bootstrap resampling iterations. Used for "boot", "boot632", "optimism_boot", "boot_all", and "adaptive_boot". Default is 10.

nfolds

A positive integer. For "cv", "repeatedcv", and "adaptive_cv", it indicates the number of folds. For "LGOCV" and "adaptive_LGOCV", it indicates the number of repeated training/test splits. Default is 5.

nrepeats

A positive integer indicating the number of repeats for "repeatedcv". Default is 3.

preProcess

A character vector specifying preprocessing methods passed to caret::train. Available options are "BoxCox", "YeoJohnson", "expoTrans", "center", "scale", "range", "knnImpute", "bagImpute", "medianImpute", "pca", "ica", "spatialSign", "corr", "zv", "nzv", and "conditionalX". Default is NULL.

B

A positive integer indicating the number of bootstrap samples for bagging classifiers such as "bagFDA", "bagFDAGCV", "bagEarth", and "bagEarthGCV". Default is 25.

p

A numeric value between 0 and 1 specifying the training proportion used for "LGOCV" and "adaptive_LGOCV". Default is 0.75.

resample

A character string specifying the resampling method. Allowed values are "boot", "boot632", "optimism_boot", "boot_all", "cv", "repeatedcv", "LOOCV", "LGOCV", "none", "oob", "adaptive_cv", "adaptive_boot", and "adaptive_LGOCV". The "timeslice" method is not supported by mlComb.

method

A character string specifying the caret model used by mlComb. It must be available in allMethods[, 1].

Details

The "oob" resampling method is restricted to suitable random forest, bagged tree, bagged earth, bagged flexible discriminant analysis, and conditional tree forest methods.

For "adaptive_cv" and "adaptive_LGOCV", nfolds must be greater than 5. For "repeatedcv", nrepeats must be at least 2.

Value

Invisibly returns TRUE if all checks pass. Otherwise, an error is thrown.


dtComb documentation built on June 24, 2026, 5:08 p.m.