# NOT RUN {
library("mlr3")
data = data.table::data.table(x = factor(letters[1:3]), y = factor(letters[1:3]))
task = TaskClassif$new("task", data, "x")
poe = po("encode")
# poe is initialized with encoding: "one-hot"
poe$train(list(task))[[1]]$data()
# other kinds of encoding:
poe$param_set$values$method = "treatment"
poe$train(list(task))[[1]]$data()
poe$param_set$values$method = "helmert"
poe$train(list(task))[[1]]$data()
poe$param_set$values$method = "poly"
poe$train(list(task))[[1]]$data()
poe$param_set$values$method = "sum"
poe$train(list(task))[[1]]$data()
# }
Run the code above in your browser using DataCamp Workspace