Skip to contents

Per-unit predicted outcome \(E[Y \mid do(T = t), X = x]\) – the first rung of the ladder, risk / response scoring. Under "ignorability" this is the component-gated conditional mean; under "latent_confounder" it is the regime-gated interventional mean. For a binary outcome with scale = "response" the prediction is the discretised predictive probability P(Y > threshold).

Usage

proxy_predict(
  model,
  newdata,
  t,
  scale = c("link", "response"),
  threshold = 0.5
)

Arguments

model

An uplift_model.

newdata

A data frame carrying the covariate columns.

t

The treatment value to predict the outcome under.

scale

One of "link" (default) or "response".

threshold

Decision threshold for the binary discretised predictive. Default 0.5.

Value

A data.table::data.table with columns id and prediction.

Examples

set.seed(1)
dat <- data.frame(y = stats::rnorm(200), t = stats::rbinom(200, 1L, 0.5),
                  x = stats::rnorm(200))
m <- fit_uplift(dat, "y", "t", "x", N = 1L, regime = "moment")
proxy_predict(m, data.frame(x = c(-1, 0, 1)), t = 1)
#>       id   prediction
#>    <int>        <num>
#> 1:     1 -0.002176397
#> 2:     2  0.045330305
#> 3:     3  0.092837007