This is the result container object returned by benchmark().

Format

R6::R6Class object.

Construction

bmr = BenchmarkResult$new(data)

Fields

Methods

S3 Methods

Examples

set.seed(123) bmr = benchmark(expand_grid( tasks = mlr_tasks$mget("iris"), learners = mlr_learners$mget(c("classif.featureless", "classif.rpart")), resamplings = mlr_resamplings$mget("cv") )) print(bmr)
#> <BenchmarkResult> of 20 experiments in 2 resamplings: #> resampling task learner classif.mmce #> cv iris classif.rpart 0.07333333 #> cv iris classif.featureless 0.80666667 #> #> Public: aggregated(), clone(), combine(), data, get_best(), learners, #> measures, resample_result(), resample_results, resamplings, tasks
bmr$tasks
#> task_hash task_id task #> 1: edef5f3529818e77 iris <TaskClassif>
bmr$learners
#> learner_hash learner_id learner #> 1: 712b957a1b72f4f7 classif.featureless <LearnerClassifFeatureless> #> 2: e93ffc93f3a7a67d classif.rpart <LearnerClassifRpart>
bmr$resamplings
#> resampling_hash resampling_id resampling #> 1: e740f22253d1c2ee cv <ResamplingCV>
bmr$measures
#> measure_hash measure_id measure #> 1: c7a66ec863ba061f classif.mmce <MeasureClassifMMCE>
# aggregated results bmr$aggregated(objects = FALSE)
#> hash resampling_id task_id learner_id classif.mmce #> 1: a6523dd230cc46d1 cv iris classif.featureless 0.80666667 #> 2: fc917ec4badc43d8 cv iris classif.rpart 0.07333333
# aggregated results with hyperparameters as separate columns mlr3misc::unnest(bmr$aggregated(objects = FALSE, params = TRUE), "params")
#> hash resampling_id task_id learner_id classif.mmce #> 1: a6523dd230cc46d1 cv iris classif.featureless 0.80666667 #> 2: fc917ec4badc43d8 cv iris classif.rpart 0.07333333 #> method #> 1: mode #> 2: <NA>
# extract resample results and experiments rrs = bmr$resample_results print(rrs)
#> hash task_id learner_id resampling_id N #> 1: a6523dd230cc46d1 iris classif.featureless cv 10 #> 2: fc917ec4badc43d8 iris classif.rpart cv 10
rr = bmr$resample_result(rrs$hash[1]) print(rr)
#> <ResampleResult> of learner 'iris' on task 'classif.featureless' with 10 iterations #> Measure Min. 1st Qu. Median Mean 3rd Qu. Max. Sd #> classif.mmce 0.7333 0.8 0.8 0.8067 0.8 0.9333 0.05837
rr$experiment(1)$model
#> $tab #> #> setosa versicolor virginica #> 49 44 42 #> #> $features #> [1] "Petal.Length" "Petal.Width" "Sepal.Length" "Sepal.Width" #> #> attr(,"class") #> [1] "featureless"