Learn R Programming

ggRandomForests (version 4.0.0)

plot.gg_ale_interaction: Plot a gg_ale_rfsrc interaction object

Description

Renders the second-order (interaction) ALE surface from gg_ale_rfsrc (when called with xvar2.name) as a ggplot2 heatmap. Values near zero mean the two predictors act additively over that region of their joint range; large positive or negative values mark where their combined effect departs from the sum of their individual main effects.

Usage

# S3 method for gg_ale_interaction
plot(x, ...)

Value

A ggplot object.

Arguments

x

A gg_ale_interaction object.

...

Not currently used.

See Also

gg_ale_rfsrc, plot.gg_ale_rfsrc

Examples

Run this code
# \donttest{
airq.obj <- randomForestSRC::rfsrc(Ozone ~ ., data = na.omit(airquality),
                                    ntree = 50)
ale_int <- gg_ale_rfsrc(airq.obj, xvar.names = "Wind",
                         xvar2.name = "Temp", n_eval = 12)
plot(ale_int)
# }

Run the code above in your browser using DataLab