Create partitions | R Documentation |
Create a random data partition of size n
into k
non-overlapping folds of approximately the same size
get_folds(n, k = 5L, nCV = 1L, seed = NULL)
n |
(integer) Sample size |
k |
(integer) Number of folds |
nCV |
(integer) Number of different partitions to be created |
seed |
(integer vector) Optional seed for randomization (see |
Returns a matrix with n
rows and nCV
columns. Each column contains a partition with k
folds.
require(SFSI)
# Create 5 different partitions into 10 folds
# for a sample size equal to 115
out = get_folds(n=115, k=10, nCV=5)
# Size of folds at first partition
table(out[,1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.