py-why / EconML

ALICE (Automated Learning and Intelligence for Causation and Economics) is a Microsoft Research project aimed at applying Artificial Intelligence concepts to economic decision making. One of its goals is to build a toolkit that combines state-of-the-art machine learning techniques with econometrics in order to bring automation to complex causal inference problems. To date, the ALICE Python SDK (econml) implements orthogonal machine learning algorithms such as the double machine learning work of Chernozhukov et al. This toolkit is designed to measure the causal effect of some treatment variable(s) t on an outcome variable y, controlling for a set of features x.
https://www.microsoft.com/en-us/research/project/alice/
Other
3.72k stars 702 forks source link

SingleTreePolicyInterpreter should support `sample_weight` #737

Open kyleco opened 1 year ago

kyleco commented 1 year ago

Hi @kbattocchi, Thanks for all your work on econml!

Is there any specific reason that SingleTreePolicyInterpreter.interpret cannot support the sample_weight param?

The core learning should work: Internally, it could just pass the weights to PolicyTree.fit [0, 1].

From a quick look some peripheral functionality would also need to be adapted:

Am I missing something?

An alternative is using a PolicyTree or DRPolicyTree directly, however, they do not output the CATEs and standard errors like the SingleTreePolicyInterpreter. In other words, the SingleTreePolicyInterpreter has the advantage of conveniently bundling both recommended treatments AND the underlying CATE estimates (along with other functionality like risk preferences and treatment costs).

[0] https://github.com/microsoft/EconML/blob/b84072baff8ee9f44ebd6e19aff3a7194a66b0f4/econml/cate_interpreter/_interpreters.py#L414 [1] https://econml.azurewebsites.net/_autosummary/econml.policy.PolicyTree.html#econml.policy.PolicyTree.fit

kbattocchi commented 1 year ago

That sounds like a very reasonable suggestion, thanks. I'll take a look when I have some free time.