Package website: release | dev
Concise, informative summaries of machine learning models. Based on mlr3. Inspired by the summary output of (generalized) linear models.
Installation
Install the last release from CRAN:
install.packages("mlr3summary")Install the development version from GitHub:
# install.packages("pak")
pak::pak("mlr-org/mlr3summary")Example
Load data and create a task
library(mlr3)
library(mlr3summary)
data("credit", package = "mlr3summary")
task = as_task_classif(credit, target = "risk", positive = "good")Apply the summary function
summary(object = rf, resample_result = rr)
#>
#> ── General ─────────────────────────────────────────────────────────────────────
#> Task type: classif
#> Target name: risk (good and bad)
#> Feature names: age, credit.amount, duration, saving.accounts, and sex
#> Model type: classif.ranger with num.threads=1
#> Resampling: cv with folds=3
#>
#> ── Residuals ───────────────────────────────────────────────────────────────────
#> Min 1Q Median Mean 3Q Max
#> 0.06633 0.28596 0.41013 0.43297 0.56701 0.94773
#>
#> ── Performance [sd] ────────────────────────────────────────────────────────────
#>
#> ↑classif.auc (macro): 0.6812 [0.0489]
#> ↑classif.fbeta (macro): 0.6917 [0.0578]
#> ↓classif.bbrier (macro): 0.2262 [0.0239]
#> ↑classif.mcc (macro): 0.2622 [0.079]
#>
#> ── Complexity [sd] ─────────────────────────────────────────────────────────────
#>
#> sparsity: 5 [0]
#> interaction_strength: 0.5935 [0.1207]
#>
#> ── Importance [sd] ─────────────────────────────────────────────────────────────
#> pdp pfi.ce
#> duration 0.1647 [0.0251] 0.0977 [0.0414]
#> credit.amount 0.1274 [0.014] 0.0517 [0.0263]
#> saving.accounts 0.0878 [0.0514] 0.0115 [0.0057]
#> age 0.0488 [0.0132] -0.0077 [0.0176]
#> sex 0.0301 [0.0232] 0 [0.023]
#>
#> ── Effects ─────────────────────────────────────────────────────────────────────
#> pdp ale
#> duration █▅▄▁▁ █▅▄▁▁
#> credit.amount ▆▆▃▂▂ ▆▆▄▄▄
#> saving.accounts ▅▆█ ▅▆▇
#> age ▅▅▆▆▇ ▅▅▆▆▆
#> sex ▅▆ ▅▆More examples can be found in inst/demo.