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, mlr3proba or mlr3cluster. mlr3oml allows to interact with OpenML.

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

Format

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

Methods

See mlr3misc::Dictionary.

S3 methods

See also

Examples

as.data.table(mlr_tasks)
#> key task_type nrow ncol properties lgl int dbl chr fct ord pxc #> 1: boston_housing regr 506 19 0 3 13 0 2 0 0 #> 2: breast_cancer classif 683 10 twoclass 0 0 0 0 0 9 0 #> 3: german_credit classif 1000 21 twoclass 0 3 0 0 14 3 0 #> 4: iris classif 150 5 multiclass 0 0 4 0 0 0 0 #> 5: mtcars regr 32 11 0 0 10 0 0 0 0 #> 6: penguins classif 344 8 multiclass 0 3 2 0 2 0 0 #> 7: pima classif 768 9 twoclass 0 0 8 0 0 0 0 #> 8: sonar classif 208 61 twoclass 0 0 60 0 0 0 0 #> 9: spam classif 4601 58 twoclass 0 0 57 0 0 0 0 #> 10: wine classif 178 14 multiclass 0 2 11 0 0 0 0 #> 11: zoo classif 101 17 multiclass 15 1 0 0 0 0 0
task = mlr_tasks$get("penguins") # same as tsk("penguins") head(task$data())
#> species bill_depth bill_length body_mass flipper_length island sex #> 1: Adelie 18.7 39.1 3750 181 Torgersen male #> 2: Adelie 17.4 39.5 3800 186 Torgersen female #> 3: Adelie 18.0 40.3 3250 195 Torgersen female #> 4: Adelie NA NA NA NA Torgersen <NA> #> 5: Adelie 19.3 36.7 3450 193 Torgersen female #> 6: Adelie 20.6 39.3 3650 190 Torgersen male #> year #> 1: 2007 #> 2: 2007 #> 3: 2007 #> 4: 2007 #> 5: 2007 #> 6: 2007
# Add a new task, based on a subset of penguins: data = palmerpenguins::penguins data$species = factor(ifelse(data$species == "Adelie", "1", "0")) task = TaskClassif$new("penguins.binary", data, target = "species", positive = "1") # add to dictionary mlr_tasks$add("penguins.binary", task) # list available tasks mlr_tasks$keys()
#> [1] "boston_housing" "breast_cancer" "german_credit" "iris" #> [5] "mtcars" "penguins" "penguins.binary" "pima" #> [9] "sonar" "spam" "wine" "zoo"
# retrieve from dictionary mlr_tasks$get("penguins.binary")
#> <TaskClassif:penguins.binary> (344 x 8) #> * Target: species #> * Properties: twoclass #> * Features (7): #> - int (3): body_mass_g, flipper_length_mm, year #> - dbl (2): bill_depth_mm, bill_length_mm #> - fct (2): island, sex
# remove task again mlr_tasks$remove("penguins.binary")