$new(id = "renamecolumns", param_vals = list())PipeOpRenameColumns
Identifier of resulting object, default
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:
charactervector. 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 character vector.
Ignore if columns named in
renamingare not found in the input
Task. If this is
FALSE, then names found in
renamingnot found in the
Taskcause an error. Initialized to
$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): Iris Flowers #> * Target: Species #> * Properties: multiclass #> * Features (4): #> - dbl (4): PL, Petal.Width, Sepal.Length, Sepal.Width #>