stratified.partitions: Generic partitioning of an mldr object

Description Usage Arguments Value Examples

View source: R/partitions_stra.R

Description

Stratified partitioning

Generalization of the algorithm defined in: Charte, F., Rivera, A., del Jesus, M. J., & Herrera, F. (2016, April). On the impact of dataset complexity and sampling strategy in multilabel classifiers performance. In International Conference on Hybrid Artificial Intelligence Systems (pp. 500-511). Springer, Cham.

Usage

1
2
stratified.partitions(mld, is.cv = FALSE, r, seed = 10,
  get.indices = FALSE)

Arguments

mld

The mldr object to be partitioned

is.cv

Option to enable treatment of partitions as cross-validation test folds

r

A vector of percentages of instances to be selected for each partition

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 "mldr" objects

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

1
2
3
4
5
6
7
## Not run: 
library(mldr.datasets)
library(mldr)
parts.emotions <- stratified.partitions(emotions, r = c(35, 25, 40))
summary(parts.emotions[[2]])

## End(Not run)

Example output

Attaching package: 'mldr.datasets'

The following object is masked from 'package:stats':

    density

  num.attributes num.instances num.inputs num.labels num.labelsets
1             78           152         72          6            23
  num.single.labelsets max.frequency cardinality  density   meanIR     scumble
1                    6            21    1.861842 0.310307 1.408652 0.008934177
  scumble.cv     tcs
1   1.452231 9.20392

mldr.datasets documentation built on May 2, 2019, 3:43 p.m.