Skip to contents

This is the class for tasks served on OpenML. It consists of a dataset and other meta-information such as the target variable for supervised problems. This object can also be constructed using the sugar function otsk().

mlr3 Integration

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 .

Super class

mlr3oml::OMLObject -> OMLTask

Active bindings

estimation_procedure

(list())
The estimation procedure, returns NULL if none is available.

task_splits

(data.table())
A data.table containing the splits as provided by OpenML.

tags

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

parquet

(logical(1))
Whether to use parquet.

name

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

task_type

(character(1))
The OpenML task type.

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, 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 (without targets of this OMLTask).

data_name

(character())
Name of the dataset (inferred from the task name).

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

OMLTask$new(
  id,
  cache = cache_default(),
  parquet = parquet_default(),
  test_server = test_server_default()
)

Arguments

id

(integer(1))
OpenML id for the object.

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.

parquet

(logical(1))
Whether to use parquet instead of arff. If parquet is not available, it will fall back to arff. Defaults to value of option "mlr3oml.parquet" or FALSE if not set.

test_server

(character(1))
Whether to use the OpenML test server or public server. Defaults to value of option "mlr3oml.test_server", 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

try({
  library("mlr3")
  # Get a task from OpenML:
  otask = OMLTask$new(id = 31)
  # using sugar
  otask = otsk(id = 31)
  otask$data
  otask$target_names
  otask$feature_names

  # convert to mlr3 Task:
  task = as_task(otask)

  # get a task via tsk():
  tsk("oml", task_id = 31L)
  }, silent = TRUE)
#> <TaskClassif:credit-g> (1000 x 21)
#> * Target: class
#> * Properties: twoclass
#> * Features (20):
#>   - fct (13): checking_status, credit_history, employment,
#>     foreign_worker, housing, job, other_parties, other_payment_plans,
#>     own_telephone, personal_status, property_magnitude, purpose,
#>     savings_status
#>   - int (7): age, credit_amount, duration, existing_credits,
#>     installment_commitment, num_dependents, residence_since