Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

TaskGenerator

TaskGenerator Class


Description

Creates a Task of arbitrary size. Predefined task generators are stored in the dictionary mlr_task_generators, e.g. xor.

Public fields

id

(character(1))
Identifier of the object. Used in tables, plot and text output.

task_type

(character(1))
Task type, e.g. "classif" or "regr".

For a complete list of possible task types (depending on the loaded packages), see mlr_reflections$task_types$type.

param_set

(paradox::ParamSet)
Set of hyperparameters.

packages

(character(1))
Set of required packages. These packages are loaded, but not attached.

man

(character(1))
String in the format [pkg]::[topic] pointing to a manual page for this object. Defaults to NA, but can be set by child classes.

Methods

Public methods


Method new()

Creates a new instance of this R6 class.

Usage
TaskGenerator$new(
  id,
  task_type,
  packages = character(),
  param_set = ParamSet$new(),
  man = NA_character_
)
Arguments
id

(character(1))
Identifier for the new instance.

task_type

(character(1))
Type of task, e.g. "regr" or "classif". Must be an element of mlr_reflections$task_types$type.

packages

(character())
Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand via requireNamespace().

param_set

(paradox::ParamSet)
Set of hyperparameters.

man

(character(1))
String in the format [pkg]::[topic] pointing to a manual page for this object. The referenced help package can be opened via method $help().


Method format()

Helper for print outputs.

Usage
TaskGenerator$format()

Method print()

Printer.

Usage
TaskGenerator$print(...)
Arguments
...

(ignored).


Method generate()

Creates a task of type task_type with n observations, possibly using additional settings stored in param_set.

Usage
TaskGenerator$generate(n)
Arguments
n

(integer(1))
Number of rows to generate.

Returns

Method clone()

The objects of this class are cloneable with this method.

Usage
TaskGenerator$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also


mlr3

Machine Learning in R - Next Generation

v0.11.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Bernd Bischl [aut] (<https://orcid.org/0000-0001-6002-6980>), Jakob Richter [aut] (<https://orcid.org/0000-0003-4481-5554>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>), Giuseppe Casalicchio [ctb] (<https://orcid.org/0000-0001-5324-5966>), Stefan Coors [ctb] (<https://orcid.org/0000-0002-7465-2146>), Quay Au [ctb] (<https://orcid.org/0000-0002-5252-8902>), Martin Binder [aut], Marc Becker [ctb] (<https://orcid.org/0000-0002-8115-0400>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.