Learn R Programming

DALEXtra (version 2.3.0)

overall_comparison: Compare champion with challengers globally

Description

The function creates objects that present global model performance using various measures. Those date can be easily plotted with plot function. It uses auditor package to create model_performance of all passed explainers. Keep in mind that type of task has to be specified.

Usage

overall_comparison(champion, challengers, type)

Value

An object of the class overall_comparison

It is a named list containing following fields:

  • radar list of model_performance objects and other parameters that will be passed to generic plot function

  • accordance data.frame object of champion responses and challenger's corresponding to them. Used to plot accordance.

  • models_info data.frame containing information about models used in analysis

Arguments

champion

- explainer of champion model.

challengers

- explainer of challenger model or list of explainers.

type

- type of the task. Either classification or regression

Examples

Run this code
# \donttest{
library("DALEXtra")
library("mlr")
task <- mlr::makeRegrTask(
  id = "R",
  data = apartments,
  target = "m2.price"
)
learner_lm <- mlr::makeLearner(
  "regr.lm"
)
model_lm <- mlr::train(learner_lm, task)
explainer_lm <- explain_mlr(model_lm, apartmentsTest, apartmentsTest$m2.price, label = "LM")

learner_rf <- mlr::makeLearner(
  "regr.ranger"
)
model_rf <- mlr::train(learner_rf, task)
explainer_rf <- explain_mlr(model_rf, apartmentsTest, apartmentsTest$m2.price, label = "RF")

learner_gbm <- mlr::makeLearner(
  "regr.gbm"
)
model_gbm <- mlr::train(learner_gbm, task)
explainer_gbm <- explain_mlr(model_gbm, apartmentsTest, apartmentsTest$m2.price, label = "gbm")

data <- overall_comparison(explainer_lm, list(explainer_gbm, explainer_rf), type = "regression")
plot(data)
# }

Run the code above in your browser using DataLab