Description Usage Arguments Value Note Author(s) See Also Examples
Split observations or groups of observations into segments to be used for (repeated) K-fold cross-validation, (repeated) random splitting (also known as random subsampling or Monte Carlo cross-validation), or the bootstrap.
1 | perrySplits(n, control)
|
n |
an integer giving the number of observations to be split. |
control |
a control object of class |
For the foldControl
method, an object of class "cvFolds"
giving folds for (repeated) K-fold cross-validation (see
cvFolds
).
For the splitControl
method, an object of class "randomSplits"
giving random data splits (see randomSplits
).
For the bootControl
method, an object of class "bootSamples"
giving bootstrap samples (see bootSamples
).
Users may prefer the wrapper functions cvFolds
,
randomSplits
and bootSamples
.
Andreas Alfons
foldControl
, splitControl
,
bootControl
, cvFolds
,
randomSplits
, bootSamples
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(1234) # set seed for reproducibility
## data folds for K-fold cross-validation
perrySplits(20, foldControl(K = 5))
perrySplits(20, foldControl(K = 5, R = 10))
## random data splits
perrySplits(20, splitControl(m = 5))
perrySplits(20, splitControl(m = 5, R = 10))
## bootstrap samples
perrySplits(20, bootControl())
perrySplits(20, bootControl(R = 10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.