mlr3 (version 0.3.0)

mlr_tasks: Dictionary of Tasks

Description

A simple mlr3misc::Dictionary storing objects of class Task. Each task has an associated help page, see mlr_tasks_[id].

This dictionary can get populated with additional tasks by add-on packages, e.g. mlr3data.

For a more convenient way to retrieve and construct tasks, see tsk()/tsks().

Arguments

Format

R6::R6Class object inheriting from mlr3misc::Dictionary.

S3 methods

See Also

Sugar functions: tsk(), tsks()

Extension Packages: mlr3data

Other Dictionary: mlr_learners, mlr_measures, mlr_resamplings, mlr_task_generators

Other Task: TaskClassif, TaskRegr, TaskSupervised, TaskUnsupervised, Task, mlr_tasks_boston_housing, mlr_tasks_german_credit, mlr_tasks_iris, mlr_tasks_mtcars, mlr_tasks_pima, mlr_tasks_sonar, mlr_tasks_spam, mlr_tasks_wine, mlr_tasks_zoo

Examples

Run this code
# 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