python-causality-handbook icon indicating copy to clipboard operation
python-causality-handbook copied to clipboard

Issue on page /18-When-Prediction-Fails.html

Open TommyBarnes opened this issue 5 years ago • 4 comments

When training the ML model for policy, why don't you don't include coupon value?

It is a good indicator for net value, and would surely improve model performance. Then you could just try [model.predict(customer, coupon) for coupon in coupons] and select the best one.

TommyBarnes avatar Apr 07 '21 19:04 TommyBarnes

I guess this is what you eventually get to, but all the banding and extra steps are confusing to me. Frankly I'm not sure I understand the emphasis on banding, it seems it would lower the effectiveness of your results.

TommyBarnes avatar Apr 07 '21 19:04 TommyBarnes

To be clear this feedback is specifically for the "Policy With Model" section

TommyBarnes avatar Apr 07 '21 19:04 TommyBarnes

by excluding 'coupon' from model, you make predicted 'net value' independent of 'coupon', so it makes sense that the model cannot predict coupon policy.

TommyBarnes avatar Apr 07 '21 19:04 TommyBarnes

This idea

[model.predict(customer, coupon) for coupon in coupons] 

Is what is known as T-learner. I'm getting there. What I could do here is add coupon as a feature to the model, but still make the decision making by model bands.

What I'm trying here is to reproduce a common industry practice where you make a model and segment customers by that model. This approach is clearly flawed for causal inference, if you use predictive models naively.

matheusfacure avatar Apr 08 '21 11:04 matheusfacure