Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

ggRandomForests (version 1.1.2)

gg_interaction.ggRandomForests: Minimal Depth Variable Interaction data object (randomForestSRC::find.interaction).

Description

Converts the matrix returned from randomForestSRC::find.interaction to a data.frame and add attributes for S3 identification. If passed a randomForestSRC::rfsrc object, gg_interaction first runs the randomForestSRC::find.interaction function with all optional arguments.

Usage

gg_interaction.ggRandomForests(object, ...)

Arguments

object
a randomForestSRC::rfsrc object or the output from the randomForestSRC::find.interaction function call.
...
optional extra arguments passed to randomForestSRC::find.interaction.

Value

  • gg_interaction object

References

Ishwaran H. (2007). Variable importance in binary regression trees and forests, Electronic J. Statist., 1:519-537.

Ishwaran H., Kogalur U.B., Gorodeski E.Z, Minn A.J. and Lauer M.S. (2010). High-dimensional variable selection for survival data. J. Amer. Statist. Assoc., 105:205-217.

Ishwaran H., Kogalur U.B., Chen X. and Minn A.J. (2011). Random survival forests for high-dimensional data. Statist. Anal. Data Mining, 4:115-132.

See Also

randomForestSRC::rfsrc randomForestSRC::find.interaction randomForestSRC::max.subtree randomForestSRC::var.select randomForestSRC::vimp plot.gg_interaction

Examples

Run this code
## Examples from randomForestSRC package...
## ------------------------------------------------------------
## find interactions, classification setting
## ------------------------------------------------------------
## iris.obj <- rfsrc(Species ~., data = iris)
## TODO: VIMP interactions not handled yet....
## find.interaction(iris.obj, method = "vimp", nrep = 3)
## interaction_iris <- find.interaction(iris.obj)
data(interaction_iris, package="ggRandomForests")
gg_dta <- gg_interaction(interaction_iris)

plot(gg_dta, xvar="Petal.Width")
plot(gg_dta, xvar="Petal.Length")

## ------------------------------------------------------------
## find interactions, regression setting
## ------------------------------------------------------------
## airq.obj <- rfsrc(Ozone ~ ., data = airquality)
##
## TODO: VIMP interactions not handled yet....
## find.interaction(airq.obj, method = "vimp", nrep = 3)
## interaction_airq <- find.interaction(airq.obj)
data(interaction_airq, package="ggRandomForests")
gg_dta <- gg_interaction(interaction_airq)

plot(gg_dta, xvar="Temp")
plot(gg_dta, xvar="Solar.R")

## ------------------------------------------------------------
## find interactions, survival setting
## ------------------------------------------------------------
## data(pbc, package = "randomForestSRC")
## pbc.obj <- rfsrc(Surv(days,status) ~ ., pbc, nsplit = 10)
## interaction_pbc <- find.interaction(pbc.obj, nvar = 8)
data(interaction_pbc, package="ggRandomForests")
gg_dta <- gg_interaction(interaction_pbc)

plot(gg_dta, xvar="bili")
plot(gg_dta, xvar="copper")

Run the code above in your browser using DataLab