This is the class for tasks served on https://openml.org/t.

mlr3 Integration

A mlr3::Task is returned by the method $task. Alternatively, you can convert this object to a mlr3::DataBackend using mlr3::as_data_backend().

References

Vanschoren J, van Rijn JN, Bischl B, Torgo L (2014). “OpenML.” ACM SIGKDD Explorations Newsletter, 15(2), 49--60. doi: 10.1145/2641190.2641198 .

Public fields

id

(integer(1))
OpenML task id.

cache_dir

(logical(1) | character(1))
Stores the location of the cache for objects retrieved from https://openml.org. If set to FALSE, caching is disabled.The package qs is required for caching.

Active bindings

name

(character(1))
Name of the task, as extracted from the task description.

desc

(list())
Task description (meta information), downloaded and converted from the JSON API response.

data_id

(integer())
Data id, extracted from the task description.

data

(OMLData)
Access to the underlying OpenML data set via a OMLData object.

nrow

(integer())
Number of rows, as extracted from the OMLData object.

ncol

(integer())
Number of columns, as extracted from the OMLData object.

target_names

(character())
Name of the targets, as extracted from the OpenML task description.

feature_names

(character())
Name of the features, as extracted from the OMLData object.

task

(mlr3::Task)
Creates a mlr3::Task using the target attribute of the task desc.

resampling

(mlr3::Resampling)
Creates a ResamplingCustom using the target attribute of the task description.

tags

(character())
Returns all tags of the task.

Methods

Public methods


Method new()

Creates a new object of class OMLTask.

Usage

OMLTask$new(id, cache = getOption("mlr3oml.cache", FALSE))

Arguments

id

(integer(1))
OpenML task id.

cache

(logical(1) | character(1))
See field cache for an explanation of possible values. Defaults to value of option "mlr3oml.cache", or FALSE if not set.


Method print()

Prints the object. For a more detailed printer, convert to a mlr3::Task via $task.

Usage

OMLTask$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

OMLTask$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{ otask = OMLTask$new(id = 59) print(otask)
#> <OMLTask:59:Task 59: iris (Supervised Classification)> (150x5)
print(otask$target_names)
#> [1] "class"
print(otask$feature_names)
#> [1] "sepallength" "sepalwidth" "petallength" "petalwidth"
print(otask$tags)
#> [1] "basic" "study_1" "study_41" "study_50" "study_7" "study_89" #> [7] "testsuite" "under100k" "under1m"
print(otask$task)
#> <TaskClassif:Task 59: iris (Supervised Classification)> (150 x 5) #> * Target: class #> * Properties: multiclass #> * Features (4): #> - dbl (4): petallength, petalwidth, sepallength, sepalwidth
# get a task via tsk(): if (requireNamespace("mlr3")) { mlr3::tsk("oml", task_id = 59) }
#> <TaskClassif:Task 59: iris (Supervised Classification)> (150 x 5) #> * Target: class #> * Properties: multiclass #> * Features (4): #> - dbl (4): petallength, petalwidth, sepallength, sepalwidth
# }