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
Obtain a mlr3::Task by calling
as_task()
.Obtain a mlr3::Resampling by calling
as_resampling()
.
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, returnsNULL
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 fieldcache
for an explanation of possible values. Defaults to value of option"mlr3oml.cache"
, orFALSE
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"
orFALSE
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"
, orFALSE
if not set.
Method print()
Prints the object.
For a more detailed printer, convert to a mlr3::Task via $task
.
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