Learn R Programming

tools4uplift (version 0.1-0)

BinUpliftEnhanced: Univariate categorization - augmented data

Description

Univariate optimal partitionning for Uplift Models. The algorithm categorizes several variables into bins and creates an augmented dataset with the binned variables.

Usage

BinUpliftEnhanced(data, treat, outcome, var.list, n.split = 10, 
                  alpha = 0.05, n.min = 30, ylim = NULL, 
                  ylab = "Uplift", title = "Binning Results", 
                  color = NULL)

Arguments

data

a data frame containing the treatment, the outcome and the predictor to categorize.

treat

name of a binary (numeric) vector representing the treatment assignment (coded as 0/1).

outcome

name of a binary response (numeric) vector (coded as 0/1).

var.list

a vector of names representing the explanatory variables to categorize.

n.split

number of splits to test at each node. For continuous explanatory variables only (must be > 0).

alpha

significance level of the statistical test (must be between 0 and 1).

n.min

minimum number of observations per child node.

ylim

a range for the y axis.

ylab

a title for the y axis.

title

an overall title for the plot.

color

a color for the plot. If ommitted, the color will be set by default to a custom light blue.

Value

an augmented data frame with categorized variables. If a variable is enhanced, the function returns automatically a barplot.

See Also

BinUplift

Examples

Run this code
# NOT RUN {
library(tools4uplift)
data("SimUplift")

train.enhanced <- BinUpliftEnhanced(data = SimUplift, treat = "treat", outcome = "y", 
                                    var.list = colnames(SimUplift[,3:7]))
# }

Run the code above in your browser using DataLab