Consider the example below.
There, I would like to have a $set_threshold()
method (for BenchmarkResult
, ResampleResult
) to conveniently change the response predictions so to be able to re-evaluate a measure.
library(mlr3)
rr = resample(
tsk("sonar"),
lrn("classif.rpart", predict_type = "prob"),
rsmp("holdout")
)
#> INFO [14:08:30.452] [mlr3] Applying learner 'classif.rpart' on task 'sonar' (iter 1/1)
rr$prediction(1)
#> <PredictionClassif> for 69 observations:
#> row_ids truth response prob.M prob.R
#> 2 R M 1.00000000 0.0000000
#> 4 R R 0.05714286 0.9428571
#> 5 R M 1.00000000 0.0000000
#> --- --- --- --- ---
#> 203 M M 1.00000000 0.0000000
#> 206 M M 1.00000000 0.0000000
#> 207 M M 1.00000000 0.0000000
Created on 2025-04-03 with reprex v2.1.1