Skip to content
Scenario3 min read

Uplift / CATE scoring

estimate(score='ATTE') gives a historical average effect among treated clients. For targeting new clients we need CATE/uplift scores: expected treatment effect ...

Result
user_idydtenure_monthsavg_sessions_weekspend_last_monthage_yearsincome_monthlyprior_purchases_12msupport_tickets_90dpremium_usermobile_userurban_residentreferred_usermm_obstau_linkg0g1cate
010.0000000.028.8146541.077.93676750.2341011926.6983011.02.01.01.01.00.00.0454530.0454530.0890958.1379819.1423951.004414
1280.0996111.025.9133453.053.77774028.1158595104.2715093.00.01.01.00.01.00.0415140.0415140.24667960.45925778.81730718.358049
236.4004821.024.96992910.0134.76432222.9070625267.9382558.03.00.01.01.00.00.0525930.0525930.1629687.7128559.1385771.425723
342.7882380.040.6550895.059.51707431.9704906597.3270183.02.01.01.01.00.00.0362210.0362210.18875525.38651031.1599325.773422
450.0000000.018.5608993.074.37093039.2372484930.0096285.01.01.01.00.00.00.0363430.0363430.17475715.35925018.6002273.240977
Result

Ground truth ATE is 19.40958652966079 Ground truth ATTE is 10.914991423363862

Result

CausalData(df=(100000, 14), treatment='d', outcome='y', confounders=['tenure_months', 'avg_sessions_week', 'spend_last_month', 'age_years', 'income_monthly', 'prior_purchases_12m', 'support_tickets_90d', 'premium_user', 'mobile_user', 'urban_resident', 'referred_user'], user_id='user_id')

Result
value
field
estimandATTE
modelIRM
value11.9234 (ci_abs: 7.2060, 16.6407)
value_relative25.5961 (ci_rel: 15.1433, 36.0490)
alpha0.0500
p_value0.0000
is_significantTrue
n_treated4949
n_control95051
treatment_mean58.5062
control_mean76.0871
time2026-05-06

Uplift / CATE scoring

estimate(score='ATTE') gives a historical average effect among treated clients. For targeting new clients we need CATE/uplift scores: expected treatment effect conditional on pre-treatment features.

The uplift scorer is lazy: IRM.fit(...), estimate(score='ATTE'), and estimate(score='GATE') do not train extra scoring models. The first predict_cate(...) call trains final full-sample outcome models and caches them for reuse.

Result

(False, False)

Score new clients

New scoring data must contain only pre-treatment features. In this synthetic notebook we sample rows from the generated data to mimic new clients, but we keep cate only as oracle ground truth for demonstration.

Result
user_idtenure_monthsavg_sessions_weekspend_last_monthage_yearsincome_monthlyprior_purchases_12msupport_tickets_90dpremium_usermobile_userurban_residentreferred_user
07572228.1391816.0260.70094927.1256625931.5706007.01.00.01.00.00.0
18018511.1857055.093.61370618.0000005548.7519380.00.00.01.00.01.0
21986514.0812790.0140.37425740.4556973075.9232624.01.01.01.00.00.0
3767004.3017192.061.64522218.0000003760.4452894.02.01.01.01.00.0
49299236.3659676.0500.00000047.95376012208.9112766.02.01.01.01.00.0
Result
user_idpredicted_cateoracle_cate
075722-18.7938211.927333
180185-7.4636411.192551
21986552.9157853.499984
376700-5.5240181.066981
49299232.12191717.968981
57643525.40836738.989121
684005-298.488939214.828824
780918-6.0282010.525502
860768-12.2033946.126396
950075-3.28851610.670732
Result

(True, True)

Simple targeting policy

For a continuous LTV-style outcome, predicted_cate is already on the outcome scale. A simple policy targets clients when expected incremental LTV exceeds treatment cost.

Result
user_idpredicted_cateoracle_cateexpected_incremental_valuerecommended_treatment
21986552.9157853.49998452.865785True
49299232.12191717.96898132.071917True
57643525.40836738.98912125.358367True
950075-3.28851610.670732-3.338516False
376700-5.5240181.066981-5.574018False
780918-6.0282010.525502-6.078201False
180185-7.4636411.192551-7.513641False
860768-12.2033946.126396-12.253394False
075722-18.7938211.927333-18.843821False
684005-298.488939214.828824-298.538939False

Interpretation: predicted_cate is not a true individual treatment effect. It is the model's estimate of the conditional average treatment effect for clients with similar pre-treatment features.