iterative.stratification.kfolds {mldr.datasets} | R Documentation |
Partition an mldr object into k folds
Description
Iterative stratification
Implemented from the algorithm explained in: Konstantinos Sechidis, Grigorios Tsoumakas, and Ioannis Vlahavas. 2011. On the stratification of multi-label data. In Proceedings of the 2011 European conference on Machine learning and knowledge discovery in databases - Volume Part III (ECML PKDD'11), Dimitrios Gunopulos, Thomas Hofmann, Donato Malerba, and Michalis Vazirgiannis (Eds.), Vol. Part III. Springer-Verlag, Berlin, Heidelberg, 145-158.
Usage
iterative.stratification.kfolds(mld, k = 5, seed = 10,
get.indices = FALSE)
Arguments
mld |
The |
k |
The number of folds to be generated. By default is 5 |
seed |
The seed to initialize the random number generator. By default is 10. Change it if you want to obtain partitions containing different samples, for instance to use a 2x5 fcv strategy |
get.indices |
A logical value indicating whether to return lists of indices or lists of |
Value
An mldr.folds
object. This is a list containing k elements, one for each fold. Each element is made up
of two mldr objects, called train
and test
Examples
## Not run:
library(mldr.datasets)
library(mldr)
folds.emotions <- iterative.stratification.kfolds(emotions)
summary(folds.emotions[[1]]$train)
summary(folds.emotions[[1]]$test)
## End(Not run)