Create new task identical to the old one, but with newdata instead of old data. This should either preserve the orig.features of the original task, or should add new noise-features, in which case orig.features should mark the features that correspond to the full original task.

clonetask(
  task,
  newdata,
  newid,
  orig.features = rep(TRUE, ncol(newdata) - length(getTaskTargetNames(task)))
)

Arguments

task

[Task] mlr Task to use.

newdata

[data.frame] data to replace task data with; must include the target column with same name.

newid

[character(1)] ID to use for new Task.

orig.features

[logical] features that correspond to original task's data.

Value

Task

See also