summary.Learner {mlr3summary}R Documentation

Summarizing mlr3 Learners

Description

summary method for mlr3::Learner. The output can be tailored via the control argument, see summary_control.

Usage

## S3 method for class 'Learner'
summary(object, resample_result = NULL, control = summary_control(), ...)

## S3 method for class 'GraphLearner'
summary(object, resample_result = NULL, control = summary_control(), ...)

## S3 method for class 'summary.Learner'
print(x, digits = NULL, n_important = NULL, hide = NULL, ...)

Arguments

object

(mlr3::Learner)
trained model of class Learner.

resample_result

(mlr3::ResampleResult)
outcome of resample. If NULL (default), no residuals, performances, etc. are derived.

control

(summary_control)
a list with control parameters, see summary_control.

...

(any)
further arguments passed to or from other methods.

x

(summary.Learner)
an object of class "summary.Learner", usually a result of a call to summary.Learner.

digits

(numeric(1))
the number of digits to use when printing.

n_important

(numeric(1))
number of important variables to be displayed. If NULL, x$control$n_important is used.

hide

(character)
Names of paragraphs which should not be part of the summary. Possible values are "general", "residuals", "performance", "complexity", "fairness", "importance", "effect". If NULL, no paragraph is hided.

Details

This function can be parallelized with the future package. One job is one resampling iteration, and all jobs are sent to an apply function from future.apply in a single batch. To select a parallel backend, use future::plan().

Value

summary.Learner returns an object of class "summary.Learner", a list with the following entries.

For details on the performance measures, complexity measures, feature importance and feature effect methods, see summary_control.

References

Bischl, Bernd, Sonabend, Raphael, Kotthoff, Lars, Lang, Michel (2024). Applied machine learning using mlr3 in R. Chapman and Hall/CRC. ISBN 9781003402848, https://mlr3book.mlr-org.com/.

Examples

if (require("mlr3")) {
  tsk_iris = tsk("iris")
  lrn_rpart =  lrn("classif.rpart", predict_type = "prob")
  lrn_rpart$train(task = tsk_iris)
  rsmp_cv3 = rsmp("cv", folds = 3L)
  rr = resample(tsk_iris, lrn_rpart, rsmp_cv3, store_model = TRUE)
  summary(lrn_rpart, rr)
}

[Package mlr3summary version 0.1.0 Index]