mlr3oml (version 0.2.0)

OMLTask: Interface to OpenML Tasks

Description

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

Arguments

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().

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.

References

mlr3omlvanschoren2014

Examples

Run this code
# NOT RUN {
otask = OMLTask$new(id = 59)

print(otask)
print(otask$target_names)
print(otask$feature_names)
print(otask$tags)
print(otask$task)

# get a task via tsk():
if (requireNamespace("mlr3")) {
  mlr3::tsk("oml", task_id = 59)
}
# }

Run the code above in your browser using DataLab