Running examples in ‘mlr3tuning-Ex.R’ failed
The error most likely occurred in:

> ### Name: TuningInstance
> ### Title: TuningInstance Class
> ### Aliases: TuningInstance
> 
> ### ** Examples
> 
> library(data.table)
> library(paradox)
> library(mlr3)
> 
> # Objects required to define the performance evaluator:
> task = tsk("iris")
> learner = lrn("classif.rpart")
> resampling = rsmp("holdout")
> measures = msr("classif.ce")
> param_set = ParamSet$new(list(
+   ParamDbl$new("cp", lower = 0.001, upper = 0.1),
+   ParamInt$new("minsplit", lower = 1, upper = 10))
+ )
> 
> terminator = term("evals", n_evals = 5)
> inst = TuningInstance$new(
+   task = task,
+   learner = learner,
+   resampling = resampling,
+   measures = measures,
+   param_set = param_set,
+   terminator = terminator
+ )
> 
> # first 4 points as cross product
> design = CJ(cp = c(0.05, 0.01), minsplit = c(5, 3))
> inst$eval_batch(design)
INFO  [03:01:49.615] Evaluating 4 configurations 
INFO  [03:01:49.620]    cp minsplit 
INFO  [03:01:49.620]  0.01        3 
INFO  [03:01:49.620]  0.01        5 
INFO  [03:01:49.620]  0.05        3 
INFO  [03:01:49.620]  0.05        5 
INFO  [03:01:50.626] Benchmark with 4 resampling iterations 
INFO  [03:01:50.629] Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [03:01:50.717] Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [03:01:50.973] Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [03:01:51.056] Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [03:01:51.322] Finished benchmark 
INFO  [03:01:51.353] Result of batch 1: 
INFO  [03:01:51.363]    cp minsplit classif.ce 
INFO  [03:01:51.363]  0.01        3       0.04 
INFO  [03:01:51.363]  0.01        5       0.04 
INFO  [03:01:51.363]  0.05        3       0.04 
INFO  [03:01:51.363]  0.05        5       0.04 
INFO  [03:01:51.368] 4 configurations evaluated 
$batch_nr
[1] 1

$uhashes
[1] "a84cf2c2-4cd7-499d-ac7e-b522fdcc5d38"
[2] "d9f7850b-6983-4689-b5bc-3f17168588f0"
[3] "48cb395e-6126-483e-83d3-fcbc92298dcd"
[4] "b7af91d0-db5b-4e5a-834a-27e2e2698d49"

$perf
   classif.ce
1:       0.04
2:       0.04
3:       0.04
4:       0.04

> inst$archive()
   nr batch_nr  resample_result task_id    learner_id resampling_id iters
1:  1        1 <ResampleResult>    iris classif.rpart       holdout     1
2:  2        1 <ResampleResult>    iris classif.rpart       holdout     1
3:  3        1 <ResampleResult>    iris classif.rpart       holdout     1
4:  4        1 <ResampleResult>    iris classif.rpart       holdout     1
   params tune_x warnings errors classif.ce
1: <list> <list>        0      0       0.04
2: <list> <list>        0      0       0.04
3: <list> <list>        0      0       0.04
4: <list> <list>        0      0       0.04
> 
> # try more points, catch the raised terminated message
> tryCatch(
+   inst$eval_batch(data.table(cp = 0.01, minsplit = 7)),
+   terminated_error = function(e) message(as.character(e))
+ )
INFO  [03:01:51.482] Evaluating 1 configurations 
INFO  [03:01:51.487]    cp minsplit 
INFO  [03:01:51.487]  0.01        7 
INFO  [03:01:51.673] Benchmark with 1 resampling iterations 
INFO  [03:01:51.676] Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [03:01:51.780] Finished benchmark 
INFO  [03:01:51.815] Result of batch 2: 
INFO  [03:01:51.821]    cp minsplit classif.ce 
INFO  [03:01:51.821]  0.01        7       0.04 
INFO  [03:01:51.825] 5 configurations evaluated 
$batch_nr
[1] 2

$uhashes
[1] "1a7a41a0-912d-4fb1-b7d3-1e37434bcdb2"

$perf
   classif.ce
1:       0.04

> 
> # try another point although the budget is now exhausted
> # -> no extra evaluations
> tryCatch(
+   inst$eval_batch(data.table(cp = 0.01, minsplit = 9)),
+   terminated_error = function(e) message(as.character(e))
+ )
Error: TuningInstance (tsk:iris, lrn:classif.rpart, term:<TerminatorEvals>) terminated

> 
> inst$archive()
   nr batch_nr  resample_result task_id    learner_id resampling_id iters
1:  1        1 <ResampleResult>    iris classif.rpart       holdout     1
2:  2        1 <ResampleResult>    iris classif.rpart       holdout     1
3:  3        1 <ResampleResult>    iris classif.rpart       holdout     1
4:  4        1 <ResampleResult>    iris classif.rpart       holdout     1
5:  5        2 <ResampleResult>    iris classif.rpart       holdout     1
   params tune_x warnings errors classif.ce
1: <list> <list>        0      0       0.04
2: <list> <list>        0      0       0.04
3: <list> <list>        0      0       0.04
4: <list> <list>        0      0       0.04
5: <list> <list>        0      0       0.04
> 
> ### Error handling
> # get a learner which breaks with 50% probability
> # set encapsulation + fallback
> learner = lrn("classif.debug", error_train = 0.5)
> learner$encapsulate = c(train = "evaluate", predict = "evaluate")
> learner$fallback = lrn("classif.featureless")
> 
> param_set = ParamSet$new(list(
+   ParamDbl$new("x", lower = 0, upper = 1)
+ ))
> 
> inst = TuningInstance$new(
+   task = tsk("wine"),
+   learner = learner,
+   resampling = rsmp("cv", folds = 3),
+   measures = msr("classif.ce"),
+   param_set = param_set,
+   terminator = term("evals", n_evals = 5)
+ )
> 
> tryCatch(
+   inst$eval_batch(data.table(x = 1:5 / 5)),
+   terminated_error = function(e) message(as.character(e))
+ )
INFO  [03:01:52.992] Evaluating 5 configurations 
INFO  [03:01:52.996]    x 
INFO  [03:01:52.996]  0.2 
INFO  [03:01:52.996]  0.4 
INFO  [03:01:52.996]  0.6 
INFO  [03:01:52.996]  0.8 
INFO  [03:01:52.996]  1.0 
INFO  [03:01:54.071] Benchmark with 15 resampling iterations 
INFO  [03:01:54.075] Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
Error: The following packages could not be loaded: evaluate
Execution halted