GetAleData.Rd
Computes the Accumulated Local Effects for several covariates in a conditional random forest and gathers them into a single data frame.
GetAleData(object, xnames=NULL, order=1, grid.size=20, parallel=FALSE)
An object as returned by cforest
(or fastcforest
).
A character vector of the covariates for which to compute the Accumulated Local Effects. If NULL (default), ALE are computed for all the covariates in the model. Should be of length 2 for 2nd order ALE.
An integer indicating whether to compute 1st order ALE (1, default) or 2nd order ALE (2).
The size of the grid for evaluating the predictions. Default is 20.
Logical indicating whether or not to run the function in parallel using a backend provided by the foreach
package. Default is FALSE
.
The computation of Accumulated Local Effects uses FeatureEffect
function from iml
package for each covariate. The results are then gathered and reshaped into a friendly data frame format.
A data frame with covariates, their categories and their accumulated local effects.
Apley, D. W., Zhu J. "Visualizing the Effects of Predictor Variables in Black Box Supervised Learning Models". arXiv:1612.08468v2, 2019.
Molnar, Christoph. "Interpretable machine learning. A Guide for Making Black Box Models Explainable", 2019. https://christophm.github.io/interpretable-ml-book/.
FeatureEffect
,GetPartialData
,GetInteractionStrength
if (FALSE) {
data(iris)
iris2 = iris
iris2$Species = factor(iris$Species == "versicolor")
iris.cf = party::cforest(Species ~ ., data = iris2,
controls = party::cforest_unbiased(mtry=2, ntree=50))
GetAleData(iris.cf)
}