powered by
Builds an interpretable tree approximating the behaviour of the underlying model using the `iml` package.
surrogate_tree(object, maxdepth = 3, data = c("train", "test"), ...)
An `iml::TreeSurrogate` object.
A `fastml` object.
Maximum depth of the surrogate tree. Default 3.
Character string specifying which data to use: "train" (default) or "test".
"train"
"test"
Additional arguments passed to `iml::TreeSurrogate`.
if (FALSE) { data(iris) iris <- iris[iris$Species != "setosa", ] iris$Species <- factor(iris$Species) model <- fastml(data = iris, label = "Species") surrogate_tree(model) }
Run the code above in your browser using DataLab