plot_infotables: Create bar charts for WOE or NWOE vectors

Description Usage Arguments Examples

Description

plot_infotable creates WOE or NWOE bar charts for one or more variables. For multi-variable plots, bar charts will be displayed in a grid for comparison.

Usage

1
2
plot_infotables(information_object = NULL, variables = NULL,
  same_scales = FALSE, show_values = FALSE)

Arguments

information_object

object generated by the information package.

variables

vector of one more variables. For multi-variable plots, bar charts will be displayed in a grid.

same_scales

if set to TRUE, all plots will have the same limits on the y-axes (default is FALSE).

show_values

if set to TRUE, values will be displayed on the bar chart (default is FALSE).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
##------------------------------------------------------------
## WOE plots
##------------------------------------------------------------
library(Information)
data(train, package="Information")
train <- subset(train, TREATMENT==1)
IV <- Information::create_infotables(data=train, y="PURCHASE", parallel=FALSE)

# Plotting a single variable
Information::plot_infotables(IV, "N_OPEN_REV_ACTS")

# Plotting multiple variables in a grid for comparison
Information::plot_infotables(IV, IV$Summary$Variable[1:4], same_scale=TRUE)

# If the goal is to plot multiple variables individually, as opposed to a comparison-grid, we can
# loop through the variable names and create individual plots
## Not run: 
names <- names(IV$Tables)
plots <- list()
for (i in 1:length(names)){
  plots[[i]] <- plot_infotables(IV, names[i])
}
# Showing the top 18 variables
plots[1:18]

## End(Not run)

# We can speed up the creation of the information tables by invoking the parallel option (default)
# If we leave ncore as the default, create_infotables() will set ncore to available clusters - 1
## Not run: 
train <- subset(train, TREATMENT==1)
IV <- Information::create_infotables(data=train, y="PURCHASE")

## End(Not run)
closeAllConnections()

Example output

[1] "Variable TREATMENT was removed because it has only 1 unique level"
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

[[16]]

[[17]]

[[18]]

[1] "Variable TREATMENT was removed because it has only 1 unique level"

Information documentation built on May 2, 2019, 7:15 a.m.