sample_cv: Cross-Validation Scheme Sampling

Description Usage Arguments Value Examples

View source: R/sample_cv.R

Description

sample_cv returns a matrix with cross-validation (CV) folds.

Usage

1
2
sample_cv(x, n_father, n_mother, n_hyb_trn, min_size, rounds, hybrid_split,
  progress = FALSE)

Arguments

x

A vector with hybrid names.

n_father

A numeric or integer scalar specifying the size of the sampled paternal parents in the training set.

n_mother

A numeric or integer scalar specifying the size of the sampled maternal parents in the training set.

n_hyb_trn

A numeric or integer scalar specifying the size of the training set.

min_size

A numeric or integer scalar specifying the minimum size of each test set class (VS0, VS1, VS2).

rounds

A numeric or integer speciyfing the number of cross-validation runs to sample.

hybrid_split

A character scalar specifying the character that separates the maternal from the paternal parent in x.

progress

A logical scalar. Set to 'TRUE' if a progress bar is desired.

Value

A matrix of dimensions length(x) by rounds with columns containing assignments of hybrids to either TRN, T0, T1 or T2.

Examples

1
2
3
4
5
data(hybrid_nms)
cv_mat <- sample_cv(hybrid_nms, n_mother = 39, n_father = 33,
                    n_hyb_trn = 200, min_size = 20, rounds = 20L,
                    hybrid_split = "_")
str(cv_mat)

mwesthues/sspredr documentation built on May 23, 2019, 10:56 a.m.