Description Usage Arguments Value Methods References Examples
Compute the interactions between variables, using an experimental method described by Breiman and Cutler. Variables m and n interact if a split on variable m in a tree makes a split on n either systematically less possible or more possible.
1 2 | ## S4 method for signature 'bigcforest'
interactions(forest)
|
forest |
A random forest of class |
A symmetrical matrix of interactions between variables. A large positive number indicates that a split on one variable inhibits a split on the other variable, and conversely. This could indicate that the two variables are strongly correlated.
signature(forest = "bigcforest")
Compute variable interactions for a classification random forest.
Breiman, L. (2001). Random forests. Machine learning, 45(1), 5-32.
Breiman, L. & Cutler, A. (n.d.). Random Forests. Retrieved from http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Classify cars in the Cars93 data set by type (Compact, Large,
# Midsize, Small, Sporty, or Van).
# Load data.
data(Cars93, package="MASS")
x <- Cars93
y <- Cars93$Type
# Select variables with which to train model.
vars <- c(4:22)
# Run model, grow 30 trees.
forest <- bigrfc(x, y, ntree=30L, varselect=vars, cachepath=NULL)
# Calculate variable interactions.
inter <- interactions(forest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.