BinUplift2d: Bivariate quantization

Description Usage Arguments Value Author(s) References Examples

View source: R/BinUplift2d.R

Description

A non-parametric heat map representing the observed uplift in rectangles that explore a bivariate dimension space. The function also returns the individual uplift based on the heatmap.

Usage

1
2
BinUplift2d(data, var1, var2, treat, outcome, valid = NULL, 
            n.split = 3, n.min = 30, plotit = FALSE, nb.col = 20)

Arguments

data

a data frame containing uplift models variables.

var1

x-axis variable name. Represents the first dimension of interest.

var2

y-axis variable name. Represents the second dimension of interest.

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).

valid

a validation data frame containing uplift models variables.

n.split

the number of intervals to consider per explanatory variable. Must be an integer > 1.

n.min

minimum number of observations per group (treatment and control) within each rectangle. Must be an integer > 0.

plotit

if TRUE, a heatmap of observed uplift per rectangle is plotted.

nb.col

number of colors for the heatmap. Default is 20. Must be an integer and should greater than n.split for better visualization.

Value

returns an augmented dataset with Uplift_var1_var2 variable representing a predicted uplift for each observation based on the rectangle it belongs to. The function also plots a heat map of observed uplifts.

Author(s)

Mouloud Belbahri

References

Belbahri, M., Murua, A., Gandouet, O., and Partovi Nia, V. (2021) Uplift Regression : The R Package tools4uplift, <https://arxiv.org/pdf/1901.10867.pdf>

Examples

1
2
3
4
library(tools4uplift)
data("SimUplift")

heatmap <- BinUplift2d(SimUplift, "X1", "X2", "treat", "y")

tools4uplift documentation built on Jan. 11, 2022, 3 a.m.