CV.KFold: Cross-Validation with K Folds

Description Usage Arguments Value Examples

View source: R/RandomPartition.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
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)

BMTME documentation built on Aug. 27, 2020, 1:08 a.m.

Related to CV.KFold in BMTME...