# NOT RUN {
task = mlr_tasks$get("iris")
learner = mlr_learners$get("classif.rpart")
resampling = mlr_resamplings$get("cv")
# explicitly instantiate the resampling for this task for reproduciblity
set.seed(123)
resampling$instantiate(task)
rr = resample(task, learner, resampling)
print(rr)
# retrieve performance
rr$performance("classif.ce")
rr$aggregate("classif.ce")
# merged prediction objects of all resampling iterations
pred = rr$prediction
pred$confusion
# Repeat resampling with featureless learner
rr.featureless = resample(task, "classif.featureless", resampling)
# Combine the ResampleResults into a BenchmarkResult
bmr = rr$combine(rr.featureless)
print(bmr)
# }
Run the code above in your browser using DataCamp Workspace