# Propensity versus uplift: design, round 1

Committed before any model is fitted or any score is computed. The frozen parameters are in `protocol-r1.json` and
the predictions in `predictions-r1.json`; where this note and the JSON differ, the JSON wins. Any later change is
labelled, committed before it is used, and a change made after results are seen says so on the page.

## Question

A propensity-to-buy model ranks customers by how likely they are to buy. A marketer then sends to its top deciles.
Does that reach the people the send changes, or the people who would have bought anyway? On real randomized tests,
compare the effect of the send in each decile of a propensity model with the same deciles of an uplift model, a model
trained for the effect itself.

## Overlap test (one question, one study)

- `retail-win-back` (online retail orders, no contact recorded) measures who comes back with no contact and sizes a
  holdout. It has no randomized send, no model and no effect by score.
- `product-usage-account-scoring` tests the checks on a warehouse-to-CRM score sync in a simulation. Its score is
  given; the question is what breaks between warehouse and CRM.
- `retargeting-holdout`, including its sales motions part, simulates one company where the shape of the effect
  across buyers is set by the design, so how far a propensity list overstates a motion is fixed by an assumption.
- `ranking-lifecycle` retrains and rolls back a recommender on movie ratings. No treatment.
- `trial-to-paid-retention` and `credit-model-validation` score who will cancel or default; neither has a randomized
  treatment, so neither can say who a contact changes.

This study is the only one where the effect of a send is measured, not assumed, in each slice of a model's ranking,
on two public randomized tests. Different question and different data: a new study.

## Data

1. **Primary: the MineThatData e-mail test** (Kevin Hillstrom, 2008). 64,000 customers who bought in the past
   twelve months, split at random into thirds: a Mens e-mail, a Womens e-mail, no e-mail. Purchase, visit and spend
   over the two weeks after. Primary comparison: **Mens e-mail against no e-mail** (42,613 customers), the e-mail
   with the larger average effect in the published challenge. The Womens e-mail against no e-mail is reported beside
   it, never pooled with it.
2. **Follow-up: the Criteo uplift prediction dataset v2.1** (CC BY-NC-SA 4.0), randomized incrementality tests of
   display advertising, 13,979,592 users, 85% treated. A deterministic one-in-four sample (`tools/get_data.py`,
   keyed hash of the row number) keeps 3,494,359 users. Features are anonymized and the publisher sub-sampled the
   data so the true incrementality level is hidden, so only rankings are compared there, never the size of the
   effect as a business figure.

Before this design, only arm sizes and average rates were looked at (listed in the protocol).

## Outcome

Primary: purchase within the window (Hillstrom `conversion`, Criteo `conversion`). Secondary: visit. Money (Hillstrom
only): spend.

## Models, fitted out of fold

Five-fold cross-fitting: customers are split into five folds at random within each arm (seed in the protocol). Every
model is fitted on four folds and scores the fifth, so every customer gets scores from models that never saw them.

- **Propensity model**: chance of a purchase with no send, fitted on the no-send arm. This is the "who will buy"
  score. Logistic regression and gradient boosting.
- **Response model**: chance of a purchase after a send, fitted on the sent arm. The classic direct-marketing
  response model. Same two algorithms.
- **Uplift, two models**: response minus propensity, same algorithm. **Uplift, transformed outcome**: one gradient
  boosting regressor on Z = Y (T − e) / (e (1 − e)), e the sent share in the training folds, on both arms.
- **Simple baseline (Hillstrom)**: rank by past-year spend, ties by fewer months since the last purchase.
- **Random**: the straight line.

Primary pair, fixed now: **the logistic propensity model against the logistic two-model uplift**. Logistic
regression is the default a practitioner reaches for and needs no tuning. Every other ranking is reported beside the
pair as description.

## Measures

1. How well the propensity model ranks buyers with no send: AUC on the no-send arm (out of fold) with a 95% bootstrap
   interval, against the past-spend rule; Brier score and its skill against the base rate; a reliability curve in
   ten equal-count bins.
2. The effect of the send by decile of each ranking: purchase rate sent minus not sent, in points, with a 95%
   Newcombe interval. Deciles are equal-count over both arms of the pair.
3. **Would have bought anyway**: in a group, the purchase rate without the send divided by the rate with it, the
   share of purchases by sent customers that would have happened anyway. Bootstrap interval.
4. Qini curve: extra purchases per 1,000 customers on the list when sending to the top k% of a ranking. Decision
   share fixed now: **the top 30%**. The difference between the primary pair at 30%, with a paired bootstrap
   interval, is the main test. Qini coefficient (area between the curve and the random line) for every ranking.
5. Money (Hillstrom, Mens e-mail): extra spend per 1,000 customers when sending to the top k%, times an assumed
   margin, minus an assumed cost per send, over the grid in the protocol. The best share is read off the same data
   and says so.

Bootstrap: Poisson(1) weights by customer, seeded; the scores are held fixed, so model refitting noise is measured
separately, by refitting everything on Hillstrom with four more fold seeds.

## Follow-up (run, not promised)

The same models, folds, pair and measures on the Criteo sample, purchase as the outcome, visit beside it: does the
ranking of the propensity model and the uplift model at the top 30% hold on a test with about 80 times the customers?

## Predictions

Nine, each with the expected result and its opposite, in `predictions-r1.json`. Each is scored held, missed or
untestable, and every one is reported.

## What the headline will be

The finding that changes who a marketer should send to, by an amount the setup did not fix: the primary pair at the
top 30% and the would-have-bought-anyway share. The follow-up's result goes in the paragraph under it.
