Skip to contents

This function makes a bar plot of rule frequency and coverage

Usage

plot_bar(
  df,
  Y,
  fit,
  featureLabels,
  maxLen,
  topRules = 10,
  and = " AND ",
  neg = "NOT ",
  minProp = 0,
  simplify = T,
  oppmat = NULL,
  oppind = NULL,
  heightBuffer = 1,
  plotBuffer = 0,
  textSize = 16,
  boot_rep = 100
)

Arguments

df

dataframe of binary features

Y

vector of binary outcome

fit

output from function BRS

featureLabels

data frame whose first column is feature names (as they appear in df) and whose second column is the corresponding labels to be displayed on the graph

maxLen

integer maximum length of rules

topRules

the max number of rules to plot for each length

and

string for how an "and" statement will be concatenated

neg

string for how a "not" statement will be prefaced

minProp

minimum proportion of rule sets in which a rule must appear before being plotted

simplify

whether to simplify negative rules when possible. If true, then a negative rule is changed to it's positive counterpart if and only if there are only two possible values for the corresponding variable (e.g. "A_1_neg" is changed to "A_0" if and only if the only two possible values for "A" are 0 and 1)

heightBuffer

amount by which to shift bottom of graph up to make room for label

textSize

size parameter passed to ggplot2::element_text

Value

bar plot with frequency and coverage of rules