PipeOpRenameColumns$new(id = "renamecolumns", param_vals = list())
Identifier of resulting object, default
param_vals :: named
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction. Default
Input and output channels are inherited from
The output is the input
Task with the old column names changed to the new ones.
$state is a named
list with the
$state elements inherited from
The parameters are the parameters inherited from
PipeOpTaskPreprocSimple, as well as:
renaming :: named
character vector. The names of the vector specify the old column names that should be
changed to the new column names as given by the elements of the vector. Initialized to the empty
Ignore if columns named in
renaming are not found in the input
Task. If this is
FALSE, then names found in
renaming not found in the
Task cause an error.
$rename() mutator of the
Task to set the new column names.
library("mlr3") task = tsk("iris") pop = po("renamecolumns", param_vals = list(renaming = c("Petal.Length" = "PL"))) pop$train(list(task))#> $output #> <TaskClassif:iris> (150 x 5) #> * Target: Species #> * Properties: multiclass #> * Features (4): #> - dbl (4): PL, Petal.Width, Sepal.Length, Sepal.Width #>