View source: R/plot_light_effects.R
plot.light_effects | R Documentation |
Visualizes response-, prediction-, partial dependence, and/or ALE profiles
of a (multi-)flashlight with respect to a covariable v
.
Different flashlights or a single flashlight with one "by" variable are separated
by a facet wrap.
## S3 method for class 'light_effects'
plot(
x,
use = c("response", "predicted", "pd"),
zero_counts = TRUE,
size_factor = 1,
facet_scales = "free_x",
facet_nrow = 1L,
rotate_x = TRUE,
show_points = TRUE,
...
)
x |
An object of class "light_effects". |
use |
A vector of elements to show. Any subset of ("response", "predicted", "pd", "ale") or "all". Defaults to all except "ale" |
zero_counts |
Logical flag if 0 count levels should be shown on the x axis. |
size_factor |
Factor used to enlarge default |
facet_scales |
Scales argument passed to |
facet_nrow |
Number of rows in |
rotate_x |
Should x axis labels be rotated by 45 degrees? |
show_points |
Should points be added to the line (default is |
... |
Further arguments passed to geoms. |
An object of class "ggplot".
light_effects()
, plot_counts()
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "iris", data = iris, y = "Sepal.Length")
plot(light_effects(fl, v = "Species"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.