plot.light_performance: Visualize Model Performance
Description
Minimal visualization of an object of class "light_performance" as
ggplot2::geom_bar(). The object returned has class "ggplot",
and can be further customized.
Should representation of dimensions
(either two "by" variables or one "by" variable and multiflashlight)
of x aesthetic and dodge fill aesthetic be swapped? Default is FALSE.
The plot is organized as a bar plot as follows:
For flashlights without "by" variable specified, a single bar is drawn.
Otherwise, the "by" variable (or the flashlight label if there is no "by" variable)
is represented by the "x" aesthetic.
The flashlight label (in case of one "by" variable) is represented by dodged bars.
This strategy makes sure that performance of different flashlights can
be compared easiest. Set "swap_dim = TRUE" to revert the role of dodging and x
aesthetic. Different metrics are always represented by facets.
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "ols", data = iris, y = "Sepal.Length")
plot(light_performance(fl, by = "Species"), fill = "darkred")