Machine Learning · hard · Asked at FinTech

Explain how you'd build an uplift/causal model for a marketing campaign.

Asked in Data Scientist interviews, in the Machine Learning round.

Short answer

Model treatment effect (T-learner/uplift trees) using randomized/quasi-experimental data.

How to answer it

The question is not "who will buy" but "who will buy because we contacted them". Four groups: people who buy either way, people who buy only if contacted, people who never buy, and people who buy unless contacted. Only the second group is worth the cost, and a plain response model cannot tell the first two apart.

Data first. Uplift needs a treatment and a control group assigned at random, so the difference in outcome is caused by the treatment. If a past campaign had a holdout, use it; if not, run one now with a randomised holdout before modelling anything.

Then the model. Start simple:

m_t = GradientBoostingClassifier().fit(X[treated], y[treated])
m_c = GradientBoostingClassifier().fit(X[~treated], y[~treated])
uplift = m_t.predict_proba(X)[:, 1] - m_c.predict_proba(X)[:, 1]

Evaluate with a Qini or uplift curve on a held-out randomised set: sort by predicted uplift, and check that the top deciles show a larger treated-minus-control lift than the bottom ones. Accuracy on the outcome is meaningless here. Deployment is a ranking: contact the top X% by uplift, where X is set by the budget, and keep a holdout running so the model can be re-evaluated as behaviour drifts.

Related questions

Practice this for real