Create a plot to explore relation between categorical variable and a binary target
target_explore_cat(
data,
var,
target = "target_ind",
min_val = NA,
max_val = NA,
flip = TRUE,
num2char = TRUE,
title = NA,
auto_scale = TRUE,
na = NA,
max_cat = 25,
color = c("#ECEFF1", "#CFD8DC", "#B0BEC5", "#90A4AE"),
legend_position = "bottom"
)
Plot object
A dataset
Categorical variable
Target variable (0/1 or FALSE/TRUE)
All values < min_val are converted to min_val
All values > max_val are converted to max_val
Should plot be flipped? (change of x and y)
If TRUE, numeric values in variable are converted into character
Title of plot
Not used, just for compatibility
Value to replace NA
Maximum numbers of categories to be plotted
Color vector (4 colors)
Position of legend ("right"|"bottom"|"non")