Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

CV_partition

Cross validation partition


Description

Partition the genotype indices into training and validation sets for cross-validation (CV).

Usage

CV_partition(cross.ind, k = 5)

Arguments

cross.ind

Character vector with the same length as the number of genotypes which specifies to which cross each genotype belongs.

k

Numeric value representing the number of subsets (fold) into which data are spread within cross. Default = 5.

Details

The genotype indices are randomly assigned within cross to k subsets (folds). Then each subset is used once as validation set, the remaining data go in the training set.

Value

Return:

fold

List of k lists (one for each fold). Each fold list contains two vectors with genotypes indices of the training ($train.set) and the validation set ($val.set).

Author(s)

Vincent Garin

See Also

Examples

data(mppData)

part.cv <- CV_partition(cross.ind = mppData$cross.ind, k = 5)

part.cv[[1]]$train.set
part.cv[[1]]$val.set

mppR

Multi-Parent Population QTL Analysis

v1.2.1
GPL-3
Authors
Vincent Garin [aut, cre], Valentin Wimmer [aut], Dietrich Borchardt [ctb, dtc], Fred van Eeuwijk [ctb, ths], Marcos Malosetti [ctb, ths]
Initial release
2020-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.