| overall_comparison {DALEXtra} | R Documentation |
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)
Arguments
champion |
- explainer of champion model. |
challengers |
- explainer of challenger model or list of explainers. |
type |
- type of the task. Either classification or regression |
Value
An object of the class overall_comparison
It is a named list containing following fields:
-
radarlist ofmodel_performanceobjects and other parameters that will be passed to genericplotfunction -
accordancedata.frame object of champion responses and challenger's corresponding to them. Used to plot accordance. -
models_infodata.frame containing information about models used in analysis
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)