How cross-validation runs, shared by
fineMappingPipeline and twasWeightsPipeline.
folds, numThreads, samplePartition and
fitFullData mean the same thing in both. maxVariants and
weightMethods are honoured by twasWeightsPipeline
only and are ignored by fineMappingPipeline, so
one bundle can be handed to either pipeline unchanged.
Usage
CrossValidationParam(
folds = 0,
numThreads = 1,
samplePartition = NULL,
maxVariants = NULL,
weightMethods = NULL,
fitFullData = TRUE
)Arguments
- folds
Integer. Number of folds;
0(the default) or1skips cross-validation. The same value in both pipelines —twasWeightsPipelineused to default to5, which made an unspecified setting mean two different things.- numThreads
Integer. Parallel workers for the per-fold refits.
1(default) is serial;-1uses all cores. Only consulted whenfolds > 1.- samplePartition
Optional pre-defined partition
data.framewith columnsSampleandFold. When supplied, every method reuses this exact partition instead of generating a fresh one.- maxVariants
Integer. Cap on the number of variants used for CV; unset means no limit.
twasWeightsPipelineonly —fineMappingPipelineignores it, because it does not use thetwasWeightsCvengine this configures.- weightMethods
Optional override of which methods are cross-validated, as a character vector of tokens or a named method list. Unset cross-validates every method that produced non-zero weights.
twasWeightsPipelineonly —fineMappingPipelineignores it, because itsmethods=are fine-mapping methods and its CV refits all of them.- fitFullData
Logical.
TRUE(default) fits the final model on the full data as well as cross-validating it;FALSEkeeps only the cross-validation results, and requiresfolds >= 2. A row from such a run carries itscvResultand nothing else, so it cannot be exported and cannot supply full-data weights or fits downstream.
Value
A CrossValidationParam object, a MethodParam.
Examples
CrossValidationParam(folds = 10, numThreads = 4)
#> <CrossValidationParam>
#> folds 10
#> numThreads 4
#> fitFullData TRUE
#> unset: samplePartition, maxVariants, weightMethods
CrossValidationParam(folds = 5, fitFullData = FALSE)
#> <CrossValidationParam>
#> folds 5
#> numThreads 1
#> fitFullData FALSE
#> unset: samplePartition, maxVariants, weightMethods