View source: R/ranger_RF_util.R
balanced.folds | R Documentation |
Get balanced folds where each fold has close to overall class ratio
balanced.folds(y, nfolds = 3)
y |
A response vector. If a factor, classification is assumed, otherwise regression is assumed. |
nfolds |
The number of folds in the cross validation. |
folds
Shi Huang
y<-factor(c(rep("A", 15), rep("B", 15), rep("C", 15), rep("D", 15))) print(balanced.folds(y, nfolds=3)) y<- 1:60 print(balanced.folds(y, nfolds=3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.