View source: R/overall_comparison.R
overall_comparison | R Documentation |
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.
overall_comparison(champion, challengers, type)
champion |
- explainer of champion model. |
challengers |
- explainer of challenger model or list of explainers. |
type |
- type of the task. Either classification or regression |
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.