plot a histogram of customer segments and enrollment percentages, based on the membership of ctree leaf nodes. The plot is a "histogram" whose x-axis is the average "True" response for each ctree leaf node and whose height is the number of customers in each corresponding group. Strong results have nodes with high membership far from the sample mean.
1 2 3 |
df |
data.frame with response variable to be explained and all explanatory variables to be used in ctree classificaiton |
df.ct |
ctree already trained on data, that is used to classify the data points in each sub sample. |
responseCol |
the name of the variable that the ctree is trying to explain |
title |
figure title of the plot |
idCol |
column with data row identifiers in it, which is removed from the df |
xlab |
label for x-axis of the figure |
normalize |
boolean for whether the x-axis should be percentages compared to the sample mean or absolute percentages |
compareData |
optional data.fram of one additional set of bar values to be plotted as well. |
colors |
optional named list specifying the figure colors. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.