cv_folding
creates folds used in classifier training within the survey
data.
cv_folding(data, L2.unit, k.folds, cv.sampling = c("individuals", "L2 units"))
Returns a list with length specified by k.folds
argument. Each
element is a tibble with a fold used in k-fold cross-validation.
The survey data; must be a tibble.
The column name of the factor variable identifying the context-level unit
An integer value indicating the number of folds to be generated.
Cross-validation sampling method. A character-valued
scalar indicating whether cross-validation folds should be created by
sampling individual respondents (individuals
) or geographic units
(L2 units
). Default is L2 units
. Note: ignored if
folds
is provided, but must be specified otherwise.