plot.overall_comparison: Plot function for overall_comparison

View source: R/plot.overall_comparison.R

plot.overall_comparisonR Documentation

Plot function for overall_comparison

Description

The function plots data created with overall_comparison. For radar plot it uses auditor's plot_radar. Keep in mind that the function creates two plots returned as list.

Usage

## S3 method for class 'overall_comparison'
plot(x, ...)

Arguments

x

- data created with overall_comparison

...

- other parameters

Value

A named list of ggplot objects.

It consists of:

  • radar_plot plot created with plot_radar

  • accordance_plot accordance plot of responses. OX axis stand for champion response, while OY for one of challengers responses. Colour indicates on challenger.

Examples


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)


DALEXtra documentation built on June 14, 2022, 9:07 a.m.