Learn R Programming

BMTME (version 1.0.4)

CV.KFold: Cross-Validation with K Folds

Description

This method consists of randomly dividing the training data set and the test data set.

Usage

CV.KFold(DataSet, DataSetID = "Line", K = 5, set_seed = NULL)

Arguments

DataSet

(data.frame) The object need contain three columns in the Tidy data format: $Line is the Line or genotype identifier, and the name of this column could change. $Env is the name of the evaluated environment (s). $Response Variable response obtained for the row corresponding to line and environment.

DataSetID

(string) The ID of the lines.

K

(integer) Number of groups to the cross-validation.

set_seed

(integer) Seed number for reproducible research. Is NULL by default

Value

Returns a nested list, with a positions to use as testing.

Examples

Run this code
# NOT RUN {
data("WheatMadaToy")
phenoMada <- (phenoMada[order(phenoMada$GID),])
pheno <- data.frame(GID = phenoMada[, 1], Response = phenoMada[, 3])

CV.KFold(pheno)
CV.KFold(pheno, set_seed = 123)
CV.KFold(pheno, DataSetID = 'GID', set_seed = 123)
CV.KFold(pheno, DataSetID = 'GID', K = 10, set_seed = 123)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab