if (requireNamespace("rpart")) {
library(mlr3)
lrn = lrn("regr.rpart")
task = mlr_tasks$get("boston_housing")
# Robustify the learner for the task.
gr = pipeline_robustify(task, lrn) %>>% po("learner", lrn)
# or equivalently
gr = mlr_graphs$get("robustify", task = task, learner = lrn) %>>% po(lrn)
# or equivalently
gr = ppl("robustify", task, lrn) %>>% po("learner", lrn)
# all Graphs currently in the dictionary:
as.data.table(mlr_graphs)
}
Run the code above in your browser using DataLab