Skip to content

Task cbind breaks when task's backend has primary_key different to ..row_id #961

Closed
@sebffischer

Description

@sebffischer
library(mlr3verse)
#> Loading required package: mlr3
library(data.table)

d = data.table(
  x = factor(letters[1:10]),
  y = rnorm(10),
  my_key = 1:10
)

backend = as_data_backend(d, primary_key = "my_key")

task = as_task_regr(backend, target = "y")

learner = as_learner(ppl("robustify") %>>% lrn("regr.rpart"))

learner$train(task)
#> Error: All backends to rbind must have the primary_key 'my_key'
#> This happened PipeOp encode's $train()

Created on 2023-08-31 with reprex v2.0.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions