# NOT RUN {
as.data.table(mlr_tasks)
task = mlr_tasks$get("iris") # same as tsk("iris")
head(task$data())
# Add a new task, based on a subset of iris:
data = iris
data$Species = factor(ifelse(data$Species == "setosa", "1", "0"))
task = TaskClassif$new("iris.binary", data, target = "Species", positive = "1")
# add to dictionary
mlr_tasks$add("iris.binary", task)
# list available tasks
mlr_tasks$keys()
# retrieve from dictionary
mlr_tasks$get("iris.binary")
# remove task again
mlr_tasks$remove("iris.binary")
# }
Run the code above in your browser using DataLab