createDummyFeatures gives wrong and unconsistant names used with two factor levels.
d <- structure(list(
a = structure(c(2L, 1L, 1L, 1L, 3L, 2L), .Label = c("1", "2", "3"), class = "factor"),
b = structure(c(2L, 1L, 1L, 1L, 1L, 2L), .Label = c("1", "2"), class = "factor"),
target = structure(c(1L, 1L, 1L, 2L, 2L, 2L), .Label = c("zero", "one"), class = "factor")),
row.names = c(NA, -6L),
class = "data.frame")
# the variable a becomes a.2 and a.3 when dummified but the variable b becomes X2 (instead of an expected b.2)
mlr::createDummyFeatures(d, target = "target", method = "reference")