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

Usage

See Dictionary.

See also

Examples

as.data.table(mlr_tasks)
#> id type measures nrow ncol logical integer numeric character #> 1: bh regr regr.mse 506 19 0 3 13 0 #> 2: iris classif classif.mmce 150 5 0 0 4 0 #> 3: mtcars regr regr.mse 32 11 0 0 10 0 #> 4: pima classif classif.mmce 768 9 0 0 8 0 #> 5: sonar classif classif.mmce 208 61 0 0 60 0 #> 6: spam classif classif.mmce 4601 58 0 0 57 0 #> 7: zoo classif classif.mmce 101 17 15 1 0 0 #> factor ordered #> 1: 2 0 #> 2: 0 0 #> 3: 0 0 #> 4: 0 0 #> 5: 0 0 #> 6: 0 0 #> 7: 0 0
mlr_tasks$get("iris")
#> <TaskClassif:iris> (150 x 5) #> Target: Species #> Features (4): #> * dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width #> #> Public: all_classes, backend, cbind(), class_n, class_names, clone(), #> col_info, col_roles, data(), feature_names, feature_types, filter(), #> formula, group, hash, head(), id, levels(), measures, ncol, negative, #> nrow, positive, properties, rbind(), replace_features(), row_ids, #> row_roles, select(), set_col_role(), set_row_role(), target_names, #> task_type, truth(), weights
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")) b = as_data_backend(data) task = TaskClassif$new("iris.binary", b, target = "Species", positive = "1") # add to dictionary mlr_tasks$add("iris.binary", task) # list available tasks mlr_tasks$keys()
#> [1] "bh" "iris" "iris.binary" "mtcars" "pima" #> [6] "sonar" "spam" "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 #> #> Public: all_classes, backend, cbind(), class_n, class_names, clone(), #> col_info, col_roles, data(), feature_names, feature_types, filter(), #> formula, group, hash, head(), id, levels(), measures, ncol, negative, #> nrow, positive, properties, rbind(), replace_features(), row_ids, #> row_roles, select(), set_col_role(), set_row_role(), target_names, #> task_type, truth(), weights
# remove task again mlr_tasks$remove("iris.binary")