splitControl: Control object for random data splits

Description Usage Arguments Value Author(s) See Also Examples

View source: R/perrySplits.R

Description

Generate an object that controls how to split n observations or groups of observations into training and test data to be used for (repeated) random splitting (also known as random subsampling or Monte Carlo cross-validation).

Usage

1
splitControl(m, R = 1, grouping = NULL)

Arguments

m

an integer giving the number of observations or groups of observations to be used as test data.

R

an integer giving the number of random data splits.

grouping

a factor specifying groups of observations.

Value

An object of class "splitControl" with the following components:

m

an integer giving the number of observations or groups of observations to be used as test data.

R

an integer giving the number of random data splits.

grouping

if supplied, a factor specifying groups of observations. The data will then be split according to the groups rather than individual observations such that all observations within a group belong either to the training or test data.

Author(s)

Andreas Alfons

See Also

perrySplits, randomSplits, foldControl, bootControl

Examples

1
2
3
set.seed(1234)  # set seed for reproducibility
perrySplits(20, splitControl(m = 5))
perrySplits(20, splitControl(m = 5, R = 10))

aalfons/perry documentation built on Nov. 27, 2021, 7:48 a.m.