【发布时间】:2017-08-16 23:46:21
【问题描述】:
我想准备一个数据集以在mlr 包的Task 中使用它。二元因子自变量应该是类因子、逻辑、字符还是整数?是否可以将具有超过 2 个类的因子变量作为因子/字符,或者是否有集成在 mlr 中的模型需要例如mlr 不会自动进行转换的模型矩阵?对于这些情况,mlr 期望哪些类?
例如:
x1 <- factor(sample(0:1, size=10, replace = TRUE))
x2 <- factor(sample(letters[1:5], size=10, replace = TRUE))
y <- sample(c("yes", "no"), size=10, replace = TRUE)
library(mlr)
makeClassifTask(data = data.frame(y, x1, x2), target = "y", positive="yes")
【问题讨论】:
标签: r machine-learning mlr