GetInteractionStrength.Rd
Computes the strength of second order interactions for covariates in a conditional random forest.
GetInteractionStrength(object, xnames=NULL)
An object as returned by cforest
(or fastcforest
).
character vector. The names of the variables for which to measure the strength of second order interactions. If NULL (default), all covariates are included.
This function calls vint
function from an old version of vip
package for each interaction. The results are then gathered and reshaped into a friendly data frame format.
A data frame with pairs of variable names and the strength of the interaction between them.
Greenwell, B. M., Boehmke, B. C., and McCarthy, A. J.: A Simple and Effective Model-Based Variable Importance Measure. arXiv preprint arXiv:1805.04755 (2018).
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))
GetInteractionStrength(iris.cf)
}