Error in the book Applied Machine Learning Using mlr3 in R example

52 Views Asked by At

I recently began exploring mlr3 through the book "Applied Machine Learning Using mlr3 in R". However, I'm currently stuck on the second example and unable to proceed further. I'm using Ubuntu 20.04 as my operating system and R version 4.3.2.

library(mlr3verse)
tasks = tsks(c("breast_cancer", "sonar"))
glrn_rf_tuned = as_learner(ppl("robustify") %>>% auto_tuner(
  tnr("grid_search", resolution = 5),
  lrn("classif.ranger", num.trees = to_tune(200, 500)),
  rsmp("holdout")
))
glrn_rf_tuned$id = "RF"
glrn_stack = as_learner(ppl("robustify") %>>% ppl("stacking", lrns(c("classif.rpart", "classif.kknn")), lrn("classif.log_reg")))

and I get this error:

Error in gunion(list(g1, g2), in_place = c(TRUE, TRUE)) : Assertion on 'ids of pipe operators of graphs' failed: Must have unique names, but element 18 is duplicated.

Are you encountering the same error? Could the issue be with my system configuration, or is there an error in the example itself?

0

There are 0 best solutions below