Computes the strength of second order interactions for covariates in a conditional random forest.

GetInteractionStrength(object, xnames=NULL)

Arguments

object

An object as returned by cforest (or fastcforest).

xnames

character vector. The names of the variables for which to measure the strength of second order interactions. If NULL (default), all covariates are included.

Note

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.

Value

A data frame with pairs of variable names and the strength of the interaction between them.

References

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).

Author

Nicolas Robette

Examples

  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)
  }