For a more convenient way to retrieve and construct tasks, see tsk()/tsks().
data
Format
R6::R6Class object inheriting from mlr3misc::Dictionary .
Methods
See mlr3misc::Dictionary .
S3 methods
as.data.table(dict, ..., objects = FALSE)
mlr3misc::Dictionary -> data.table::data.table()
Returns a data.table::data.table() with columns "key", "label", "task_type", "nrow", "ncol", "properties", and the number of features of type "lgl", "int", "dbl", "chr", "fct" and "ord", respectively. If objects is set to TRUE, the constructed objects are returned in the list column named object.
Examples
as.data.table(mlr_tasks)task = mlr_tasks$get("penguins")# same as tsk("penguins")head(task$data())# 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 dictionarymlr_tasks$add("penguins.binary", task)# list available tasksmlr_tasks$keys()# retrieve from dictionarymlr_tasks$get("penguins.binary")# remove task againmlr_tasks$remove("penguins.binary")