Growth Marketing · Python · XGBoost · EconML · Causal Inference
I'd been running campaigns for years before I realised a basic mistake we were all making. We were optimising the wrong thing.
The propensity model would tell us who was likely to convert. Marketing would target those users. The campaign would launch, conversions would happen, ROI looked great in the deck. Then, on a slow afternoon, someone ran a proper holdout — sliced out 20% of the targeted segment, sent them nothing, watched what happened.
The holdout group converted at almost the same rate as the treated group. We hadn't moved anyone. We'd just bought conversions we already owned.
Once you reframe targeting around incrementality, the user base splits into four groups, not one. And only one of them is worth spending money on:
Propensity models collapse the first two groups into one ("likely to convert") and don't even know the fourth exists. That's the whole bug, and most teams ship the bug for years before noticing.
This is the part I want to be honest about. Uplift modeling isn't a clever algorithm trick — it's an experiment design problem with an algorithm at the end.
You need genuine treatment and control groups from a randomised assignment. Not "the people we targeted last quarter vs the people we didn't" — those groups are different by selection, and any model you train on them will confidently learn the selection bias and call it uplift.
For a quarterly cross-sell campaign on ~500K eligible users, we structured a clean split: 350K treated, 150K held out completely. Stratified on tenure, product holdings, and last-90-day activity so the two arms weren't accidentally different. Conversions tracked over a 21-day window post-treatment.
It is genuinely painful to leave 30% of your eligible base untouched in a campaign. The CRM lead asked me twice if we really had to. We had to. Without the holdout, the model trains on observational data, and observational uplift is roughly as reliable as reading the future in tea leaves.
My first attempt was the obvious one — a single XGBoost classifier with a "treated" feature flag, then look at the change in predicted probability when you flip the flag from 0 to 1. It's quick, you only train one model, and on paper it gives you a CATE per user.
It also doesn't work. The model learns the average treatment effect across the population and shrinks individual uplifts toward that average. The persuadables and sure things end up with nearly identical scores, which defeats the entire point. I spent two evenings convincing myself it was working before the Qini curve told me it wasn't.
Settled on the T-Learner (Two-Model). Train one classifier on treated users only, train another on control users only, both predicting P(convert | features). Uplift per user = treated model's prediction − control model's prediction. It's almost embarrassingly simple. It also outperformed every more sophisticated thing I tried on this data.
from xgboost import XGBClassifier
import numpy as np
df_treat = df[df['treated'] == 1]
df_control = df[df['treated'] == 0]
features = ['tenure_days', 'product_count', 'txns_30d', 'avg_txn_value',
'last_login_days', 'tier', 'cohort_age', 'feature_depth']
model_t = XGBClassifier(max_depth=5, n_estimators=400, learning_rate=0.05,
eval_metric='logloss').fit(df_treat[features], df_treat['converted'])
model_c = XGBClassifier(max_depth=5, n_estimators=400, learning_rate=0.05,
eval_metric='logloss').fit(df_control[features], df_control['converted'])
def uplift_score(X):
p_treat = model_t.predict_proba(X)[:, 1]
p_control = model_c.predict_proba(X)[:, 1]
return p_treat - p_control
df_all['uplift'] = uplift_score(df_all[features])
I also benchmarked the X-Learner from econml, which is supposed to handle imbalanced arms better. On our split (70/30) the AUUC gap was about 2%. Production code stays simple where it can; the T-Learner won by default.
This is the trap most people walk into when they first build an uplift model: they want to validate it like a classifier. AUC, accuracy, precision-recall. None of those apply. You're not predicting a label; you're predicting a counterfactual. There is no ground truth label for "would this user have converted in the world where we didn't treat them?"
The right tool is the Qini curve. Order users by predicted uplift, descending. Plot the cumulative incremental conversions on the y-axis against the fraction of users targeted on the x-axis. Steep rise on the left = your top scores really are the persuadables. Flat line = your ranking is no better than random.
Our model's Qini-AUUC was 0.038. The standard propensity model — same features, same data, just predicting P(convert) — sat at 0.011. The uplift ranking was roughly 3.5× better at identifying incrementally valuable users. That gap is the gap between "good model" and "model that actually changes how money gets spent."
Here's the part I didn't expect. A measurable segment — about 6% of the eligible base — had negative predicted uplift. The model was telling us: don't touch these users; treatment makes them less likely to convert.
My first reaction was disbelief. Marketing's first reaction was disbelief. We pulled the segment and looked at it. They were almost all high-tenure, high-engagement users with a heavy product history. The kind of users any propensity model would flag as top targets.
The hypothesis (later half-confirmed by a follow-up survey): these are loyal customers who don't think of the relationship as transactional. A cashback push reframes the relationship as transactional, and they back off — not by churning, but by skipping the action they were probably going to take anyway. Their baseline conversion rate is high. Our intervention dropped it by 4–7 percentage points.
Until we ran an uplift model, we had no idea this segment existed. We had been targeting them every quarter. The single highest-ROI thing the model did wasn't finding new converts — it was building a suppression list we didn't know we needed.
Models that don't ship don't matter. We deployed this as a fortnightly batch job. Every other Monday, the eligible base got re-scored. The CRM platform received three tags per user:
Lost Causes weren't surfaced at all — there was nothing for the CRM team to do with them. We didn't try to "win them back"; that's a different model with a different objective.
The CRM team adjusted their send logic and we ran the new strategy for a full quarter alongside a propensity-baseline cohort that didn't get the uplift treatment.
No incremental media budget. Same channels. Same creative. The only thing that changed was who got the message.
A few things, in hindsight:
The bigger reframing — and the thing I now believe is the most important shift any analytics team can make — is moving from predicting outcomes to predicting effects. Outcomes give you a model. Effects give you a budget reallocation.
Run the code: github.com/.../nikunjkaushik-demos/uplift-modeling — runnable T-Learner on synthetic RCT data with Qini validation.
Related reading: Uplift Modeling: Measuring the True Impact of Your Campaigns