A simple Dictionary storing generator functions returning a Task.

Methods

  • get(key, ...)
    (character(1), ...) -> any
    Retrieves object with key key from the dictionary.

  • mget(keys, ...)
    (character(), ...) -> named list()
    Retrieves objects with keys keys from the dictionary, returns them in a list named with keys.

  • has(keys)
    character() -> logical()
    Returns a logical vector with TRUE at its i-th position, if the i-th key exists.

  • keys(pattern)
    character(1) -> character()
    Returns all keys which comply to the regular expression pattern.

  • add(key, value)
    (character(1), any) -> self
    Adds object value to the dictionary with key key, potentially overwriting a previously stored value.

  • remove(key)
    character() -> self
    Removes object with key key from the dictionary.

S3 methods

See also

Examples

g = mlr_generators$get("smiley") task = g$generate(10) print(task)
#> <TaskClassif:smiley_10> (10 x 3) #> Target: class #> Features (2): #> * dbl (2): V2, x4 #> #> Public: backend, cbind(), class_n, class_names, clone(), col_info, #> col_roles, data_formats, data(), droplevels(), feature_names, #> feature_types, filter(), formula(), groups, hash, head(), id, #> levels(), measures, missings(), ncol, negative, nrow, positive, #> properties, rbind(), replace_features(), row_ids, row_roles, #> select(), set_col_role(), set_row_role(), target_names, task_type, #> truth(), weights
task$data()
#> class V2 x4 #> 1: 1 1.0596425 -0.758120330 #> 2: 1 1.1871418 -0.766004349 #> 3: 2 0.9379674 0.860287037 #> 4: 2 1.0790190 0.723383120 #> 5: 3 0.6510801 -0.013342811 #> 6: 3 0.6942810 -0.003475869 #> 7: 4 -0.4067228 0.763955119 #> 8: 4 -0.8982635 0.348373685 #> 9: 4 -0.1890462 0.900333959 #> 10: 4 -1.1236600 0.032889789