Performs pure cross-validation over specified patterns with mandatory fitters. This function evaluates different pattern fitting models using cross-validation to determine the best model for a given data subset.
componentCVPatterns(
df,
rows,
cols,
patternFunctions,
patternFitters,
preferenceOrder = names(patternFunctions),
nRepeats = 40,
testFraction = 0.2,
minCellsForModels = 25,
parsimonyMargin = 0.05,
requireFitters = TRUE,
verbose = FALSE
)A list containing:
Character, the selected best pattern name
Character, explanation of the selection reasoning
Data frame with CV summary statistics for each model
Data frame with detailed results from each CV repeat
List with metadata about the CV procedure
A matrix or data frame containing the data
Row indices to subset from df
Column indices to subset from df
A named list of pattern functions to evaluate
A named list of fitter functions corresponding to each pattern
Character vector specifying the preference order of patterns (default: names of patternFunctions)
Integer, number of cross-validation repeats (default: 40)
Numeric, fraction of data to use for testing in each CV fold (default: 0.2)
Integer, minimum number of cells required for reliable CV (default: 25)
Numeric, margin for parsimony selection as fraction (default: 0.05)
Logical, whether to require fitters for all patterns (default: TRUE)
Logical, whether to print progress messages (default: FALSE)