TaskGenerator Class
Creates a Task of arbitrary size. Predefined task generators are stored in the dictionary mlr_task_generators , e.g. xor
.
Dictionary of TaskGenerators : mlr_task_generators
as.data.table(mlr_task_generators)
for a table of available TaskGenerators in the running session (depending on the loaded packages).
Extension packages for additional task types:
Other TaskGenerator: mlr_task_generators
, mlr_task_generators_2dnormals
, mlr_task_generators_cassini
, mlr_task_generators_circle
, mlr_task_generators_friedman1
, mlr_task_generators_moons
, mlr_task_generators_simplex
, mlr_task_generators_smiley
, mlr_task_generators_spirals
, mlr_task_generators_xor
id
: (character(1)
)
Identifier of the object. Used in tables, plot and text output.
label
: (character(1)
)
Label for this object. Can be used in tables, plot and text output instead of the ID.
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.
new()
Creates a new instance of this R6 class.
TaskGenerator$new(
id,
task_type,
packages = character(),
param_set = ps(),
label = NA_character_,
man = NA_character_
)
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.
label
: (character(1)
)
Label for the new instance.
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()`.
format()
Helper for print outputs.
TaskGenerator$format(...)
...
: (ignored).
print()
Printer.
TaskGenerator$print(...)
...
: (ignored).
generate()
Creates a task of type task_type
with n
observations, possibly using additional settings stored in param_set
.
TaskGenerator$generate(n)
n
: (integer(1)
)
Number of rows to generate.
Task .
clone()
The objects of this class are cloneable with this method.
TaskGenerator$clone(deep = FALSE)
deep
: Whether to make a deep clone.
Useful links