View source: R/balanced_data.R
balanced.cv.folds.from.vector | R Documentation |
Create balanced folds for cross validation
balanced.cv.folds.from.vector(dat, nfolds = 10, join.all = FALSE)
dat |
vectors representing data |
nfolds |
number of folds to be created |
join.all |
join foldids in a single vector |
list with given input, nfolds and result. The result is a list matching the input with foldid attributed to each position.
dat <- sample(c(TRUE, FALSE), 150, replace = TRUE) balanced.cv.folds.from.vector(dat, nfolds = 2) balanced.cv.folds.from.vector(dat, nfolds = 10) balanced.cv.folds.from.vector(dat, nfolds = 10, join.all = TRUE) balanced.cv.folds.from.vector(dat[1:5], nfolds = 10) # will give a warning balanced.cv.folds.from.vector(dat[1:10], nfolds = 10) # will give a warning
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.