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

Methods

See Dictionary.

S3 methods

See also

Example tasks:

Examples

as.data.table(mlr_tasks)
#> key task_type measures nrow ncol lgl int dbl chr fct #> 1: boston_housing regr regr.mse 506 19 0 3 13 0 2 #> 2: german_credit classif german_credit_costs 1000 21 0 0 7 0 12 #> 3: iris classif classif.ce 150 5 0 0 4 0 0 #> 4: mtcars regr regr.mse 32 11 0 0 10 0 0 #> 5: pima classif classif.ce 768 9 0 0 8 0 0 #> 6: sonar classif classif.ce 208 61 0 0 60 0 0 #> 7: spam classif classif.ce 4601 58 0 0 57 0 0 #> 8: wine classif classif.ce 178 14 0 2 11 0 0 #> 9: zoo classif classif.ce 101 17 15 1 0 0 0 #> ord #> 1: 0 #> 2: 1 #> 3: 0 #> 4: 0 #> 5: 0 #> 6: 0 #> 7: 0 #> 8: 0 #> 9: 0
mlr_tasks$get("iris")
#> <TaskClassif:iris> (150 x 5) #> Target: Species #> Features (4): #> * dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width
head(mlr_tasks$get("iris")$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 #> Features (4): #> * dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width
# remove task again mlr_tasks$remove("iris.binary")