0

我发现了具有简单投票预测的成本敏感 OVO 方案(https://mlr-org.github.io/mlr-tutorial/devel/html/cost_sensitive_classif/index.html)但是,有没有一种简单的方法来遵循MLR 包中包含所有基本学习器的 OVO 方案,没有成本矩阵和权重?

谢谢你!!

在@Lars 回答后编辑:

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)
4

0 回答 0