simple OVO scheme with MLR and basic learners

80 views Asked by At

I found the Cost-Sensitive OVO scheme with simple voting prediction (https://mlr-org.github.io/mlr-tutorial/devel/html/cost_sensitive_classif/index.html) but, is there a simple way to just follow a OVO scheme with all basic learners included in the MLR package without the cost matrix and weights?

thank you!!

edited after @Lars answer:

rm(list=ls(all=TRUE))
library(mlr)

df = iris
cost = matrix(runif(150 * 3, 0, 2000), 150) * (1 - diag(3))[df$Species,] + runif(150, 0, 10)
colnames(cost) = levels(iris$Species)
rownames(cost) = rownames(iris)
df$Species = NULL

costsens.task = makeCostSensTask(id = "iris", data = df, cost = cost)
costsens.task

lrn = makeLearner("classif.rotationForest")
lrn = makeCostSensWeightedPairsWrapper(lrn)
lrn

mod = train(lrn, costsens.task)
mod

getLearnerModel(mod)

pred = predict(mod, task = costsens.task)
pred

performance(pred, measures = list(meancosts, mcp), task = costsens.task)
0

There are 0 answers