Description Usage Arguments Value Author(s) Examples
View source: R/treeExplainer.R
Fits a decision tree model to another model's predictions with the aim of explaining a black box model with decision rules
1 2 | treeExplainer(train, trainedModel, sample = 0.1, seed = 1991,
maxDepth = 2)
|
train |
[data.frame | Required] Training set on which the original model was trained |
trainedModel |
[mlr model object | Required] A trained model using the mlr pacakge or produced via autoLearn |
sample |
[numeric | Optional] A number between 0 - 1 to sub-sample the training set for faster computational time. Default of 0.1 |
seed |
[integer | Optional] Random seed number for reproducable results. Default of 1991 |
maxDepth |
[integer | Optional] Max depth of the decision tree. Default of 2 |
Returns a list containing a plot
Xander Horn
1 2 | mod <- mlr::train(makeLearner("classif.ranger"), iris.task)
treeExplainer(train = iris, mod, maxDepth = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.