::: {.cell}

```{.r .cell-code}
library(mlr3verse)

tasks = tsks(c("german_credit", "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")
))
glrn_stack$id = "Stack"

learners = c(glrn_rf_tuned, glrn_stack)
bmr = benchmark(benchmark_grid(tasks, learners, rsmp("cv", folds = 3)))

bmr$aggregate(msr("classif.acc"))
```

::: {.cell-output .cell-output-stdout}

```
      nr       task_id learner_id resampling_id iters classif.acc
   <int>        <char>     <char>        <char> <int>       <num>
1:     1 german_credit         RF            cv     3   0.7650225
2:     2 german_credit      Stack            cv     3   0.7370005
3:     3         sonar         RF            cv     3   0.8122153
4:     4         sonar      Stack            cv     3   0.7307108
Hidden columns: resample_result
```


:::
:::