Learn R Programming

mlr (version 2.7)

makeMultilabelBinaryRelevanceWrapper: Use binary relevance method to create a multilabel learner.

Description

Every learner which is implemented in mlr and which supports binary classification can be converted to a wrapped binary relevance multilabel learner. The multilabel classification problem is converted into simple binary classifications for each label/target on which the binary learner is applied.

Models can easily be accessed via getLearnerModel.

Note that it does not make sense to set a threshold in the used base learner when you predict probabilities. On the other hand, it can make a lot of sense, to call setThreshold on the MultilabelBinaryRelevanceWrapper for each label indvidually; Or to tune these thresholds with tuneThreshold; especially when you face very unabalanced class distributions for each binary label.

Usage

makeMultilabelBinaryRelevanceWrapper(learner)

Arguments

Value

[Learner].

References

Tsoumakas, G., & Katakis, I. (2006) Multi-label classification: An overview. Dept. of Informatics, Aristotle University of Thessaloniki, Greece.

See Also

Other multilabel: getMultilabelBinaryPerformances

Other wrapper: makeBaggingWrapper, makeCostSensClassifWrapper, makeCostSensRegrWrapper, makeDownsampleWrapper, makeFeatSelWrapper, makeFilterWrapper, makeImputeWrapper, makeMulticlassWrapper, makeOverBaggingWrapper, makePreprocWrapperCaret, makePreprocWrapper, makeSMOTEWrapper, makeTuneWrapper, makeUndersampleWrapper, makeWeightedClassesWrapper

Examples

Run this code
d = getTaskData(yeast.task)
# drop some labels so example runs faster
d = d[, c(1:3, 15:117)]
task = makeMultilabelTask(data = d, target = c("label1", "label2", "label3"))
lrn = makeMultilabelBinaryRelevanceWrapper("classif.rpart")
lrn = setPredictType(lrn, "prob")
# train, predict and evaluate
mod = train(lrn, yeast.task)
pred = predict(mod, yeast.task)
p = performance(pred)
performance(pred, measure = hamloss)
getMultilabelBinaryPerformances(pred, measures = list(mmce, auc))
# above works also with predictions from resample!

Run the code above in your browser using DataLab