ns: Nested Stacking for multi-label Classification

Description Usage Arguments Details Value References See Also Examples

View source: R/method_ns.R

Description

Create a Nested Stacking model for multilabel classification.

Usage

1
2
3
4
5
6
7
8
9
ns(
  mdata,
  base.algorithm = getOption("utiml.base.algorithm", "SVM"),
  chain = NA,
  ...,
  predict.params = list(),
  cores = NULL,
  seed = getOption("utiml.seed", NA)
)

Arguments

mdata

A mldr dataset used to train the binary models.

base.algorithm

A string with the name of the base algorithm. (Default: options("utiml.base.algorithm", "SVM"))

chain

A vector with the label names to define the chain order. If empty the chain is the default label sequence of the dataset. (Default: NA)

...

Others arguments passed to the base algorithm for all subproblems.

predict.params

A list of default arguments passed to the predict algorithm. (default: list())

cores

Ignored because this method does not support multi-core.

seed

An optional integer used to set the seed. (Default: options("utiml.seed", NA))

Details

Nested Stacking is based on Classifier Chains transformation method to predict multi-label data. It differs from CC to predict the labels values in the training step and to regularize the output based on the labelsets available on training data.

Value

An object of class NSmodel containing the set of fitted models, including:

chain

A vector with the chain order

labels

A vector with the label names in expected order

labelset

The matrix containing only labels values

models

A list of models named by the label names.

References

Senge, R., Coz, J. J. del, & Hullermeier, E. (2013). Rectifying classifier chains for multi-label classification. In Workshop of Lernen, Wissen & Adaptivitat (LWA 2013) (pp. 162-169). Bamberg, Germany.

See Also

Other Transformation methods: brplus(), br(), cc(), clr(), dbr(), ebr(), ecc(), eps(), esl(), homer(), lift(), lp(), mbr(), ppt(), prudent(), ps(), rakel(), rdbr(), rpc()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
model <- ns(toyml, "RANDOM")
pred <- predict(model, toyml)


# Use a specific chain with C5.0 classifier
mychain <- sample(rownames(toyml$labels))
model <- ns(toyml, 'C5.0', mychain)

# Set a specific parameter
model <- ns(toyml, 'KNN', k=5)

utiml documentation built on May 31, 2021, 9:09 a.m.