Learn R Programming

mlr (version 2.13)

makeClassificationViaRegressionWrapper: Classification via regression wrapper.

Description

Builds regression models that predict for the positive class whether a particular example belongs to it (1) or not (-1).

Probabilities are generated by transforming the predictions with a softmax.

Inspired by WEKA's ClassificationViaRegression (http://weka.sourceforge.net/doc.dev/weka/classifiers/meta/ClassificationViaRegression.html).

Usage

makeClassificationViaRegressionWrapper(learner,
  predict.type = "response")

Arguments

learner

(Learner | character(1)) The learner. If you pass a string the learner will be created via makeLearner.

predict.type

(character(1)) “response” (= labels) or “prob” (= probabilities and labels by selecting the one with maximal probability).

Value

Learner.

See Also

Other wrapper: makeBaggingWrapper, makeConstantClassWrapper, makeCostSensClassifWrapper, makeCostSensRegrWrapper, makeDownsampleWrapper, makeDummyFeaturesWrapper, makeExtractFDAFeatsWrapper, makeFeatSelWrapper, makeFilterWrapper, makeImputeWrapper, makeMulticlassWrapper, makeMultilabelBinaryRelevanceWrapper, makeMultilabelClassifierChainsWrapper, makeMultilabelDBRWrapper, makeMultilabelNestedStackingWrapper, makeMultilabelStackingWrapper, makeOverBaggingWrapper, makePreprocWrapperCaret, makePreprocWrapper, makeRemoveConstantFeaturesWrapper, makeSMOTEWrapper, makeTuneWrapper, makeUndersampleWrapper, makeWeightedClassesWrapper

Examples

Run this code
# NOT RUN {
lrn = makeLearner("regr.rpart")
lrn = makeClassificationViaRegressionWrapper(lrn)
mod = train(lrn, sonar.task, subset = 1:140)
predictions = predict(mod, newdata = getTaskData(sonar.task)[141:208, 1:60])
# }

Run the code above in your browser using DataLab