R/light_breakdown.R
plot.light_breakdown.Rd
Minimal visualization of an object of class "light_breakdown" as waterfall plot. The object returned is of class "ggplot" and can be further customized.
# S3 method for class 'light_breakdown'
plot(x, facet_scales = "free", facet_ncol = 1, rotate_x = FALSE, ...)
An object of class "light_breakdown".
Scales argument passed to ggplot2::facet_wrap()
.
ncol
argument passed to ggplot2::facet_wrap()
.
Should x axis labels be rotated by 45 degrees?
Further arguments passed to ggplot2::geom_label()
.
An object of class "ggplot".
The waterfall plot is to be read from top to bottom. The first line describes the (weighted) average prediction in the query data used to start with. Then, each additional line shows how the prediction changes due to the impact of the corresponding variable. The last line finally shows the original prediction of the selected observation. Multiple flashlights are shown in different facets. Positive and negative impacts are visualized with different colors.