A simple 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.

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

Format

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

Methods

See Dictionary.

S3 methods

See also

Example tasks: iris (multi-class classification), spam (binary classification), boston_housing (regression)

Sugar function: tsk()

Other Dictionary: mlr_learners, mlr_measures, mlr_resamplings, mlr_task_generators

Other Task: TaskClassif, TaskRegr, TaskSupervised, Task

Examples

as.data.table(mlr_tasks)
#> key task_type nrow ncol lgl int dbl chr fct ord pxc #> 1: boston_housing regr 506 19 0 3 13 0 2 0 0 #> 2: german_credit classif 1000 21 0 0 7 0 12 1 0 #> 3: iris classif 150 5 0 0 4 0 0 0 0 #> 4: mtcars regr 32 11 0 0 10 0 0 0 0 #> 5: pima classif 768 9 0 0 8 0 0 0 0 #> 6: sonar classif 208 61 0 0 60 0 0 0 0 #> 7: spam classif 4601 58 0 0 57 0 0 0 0 #> 8: wine classif 178 14 0 2 11 0 0 0 0 #> 9: zoo classif 101 17 15 1 0 0 0 0 0
task = mlr_tasks$get("iris") # same as tsk("iris") head(task$data())
#> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> 1: setosa 1.4 0.2 5.1 3.5 #> 2: setosa 1.4 0.2 4.9 3.0 #> 3: setosa 1.3 0.2 4.7 3.2 #> 4: setosa 1.5 0.2 4.6 3.1 #> 5: setosa 1.4 0.2 5.0 3.6 #> 6: setosa 1.7 0.4 5.4 3.9
# 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()
#> [1] "boston_housing" "german_credit" "iris" "iris.binary" #> [5] "mtcars" "pima" "sonar" "spam" #> [9] "wine" "zoo"
# retrieve from dictionary mlr_tasks$get("iris.binary")
#> <TaskClassif:iris.binary> (150 x 5) #> * Target: Species #> * Properties: twoclass #> Features (4): #> * dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width
# remove task again mlr_tasks$remove("iris.binary")