getBalancedCVFoldIDs | R Documentation |
For binary outcomes. Create a vector of (integer) fold assignments with equal numbers of cases (and controls) across folds. Used to ensure there are as many cases as possible in all folds, particularly in imbalanced datasets.
getBalancedCVFoldIDs(data, classColname, nFolds, seed = NULL)
data |
A dataframe containing a column specified by classColname |
classColname |
A string corresponding to the binary class label (must contain only integers: 1 and 0) |
nFolds |
The number of folds to assign |
seed |
An integer to set for the random seed |
A vector of integers specifying the fold ID assigned to each row in data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.