cv_random_line | R Documentation |
This method is designed in the context of genomic selection where we have a vector of lines and we want to generate folds for cross validation. In each fold a proportion of lines is taken to be the testing set and the remaining ones to be the training set.
cv_random_line(lines, folds_number = 5, testing_proportion = 0.2)
lines |
( |
folds_number |
( |
testing_proportion |
( |
A list
with folds_number
elements where each element is a named list
with the elements training
wich includes the indices of those records to be
part of the training set and testing
wich includes the indices of those
records to be part of the testing set. Training and testing sets of each fold
are exhaustive and mutually exclusive.
## Not run:
# Generates random data
lines <- rep(paste0("line", 1:10), 4)
folds <- cv_random_line(lines, 5, 0.2)
# Indices of training set in fold 1
folds[[1]]$training
# Indices of testing set in fold 1
folds[[1]]$testing
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.