For binary/continuous targets, WOE (Weight of Evidence) statistics are computed. This function plots a WOE barplot (or lines) for an explanatory variable, based on a crossvar object.
Usage
plot_woe(
x,
metadata = NULL,
print_NA = TRUE,
numvar_as = c("bin", "value"),
title = TRUE,
do_plot = TRUE,
...
)Arguments
- x
a crossvar object, as found in profiles slot of a targeter object.
- metadata
data.frame - if metadata is loaded in R environment, label of the variables can be used. Default value (NULL) corresponds to no metadata available. The label will be used for the title and the x-axis of the graph.
- print_NA
boolean. Should we display WOE for NA values of the explanatory variable. Default: TRUE
- numvar_as
character. How should continuous explanatory variables be displayed: #'
bin (default) - display WOE for adjacent binning without respecting variable raw values
value - plot WOE using centers of binning classes, thus respecting variable raw values
- title
boolean: do we plot default generated title Y/N or character (override title) - default: TRUE
- do_plot
boolean - whether to effectively show the plot or not (internal use to combine plots)
- ...
extra parameters (not used currently)
Examples
if (FALSE) { # \dontrun{
if(interactive()){
t <- crossvar(adult, target='ABOVE50K', var='AGE')
plot_woe(t)
plot_woe(t, numvar_as='value')
}
} # }