py-why / py-why/EconML

SingleTreePolicyInterpreter should support `sample_weight`

Open
#737 1 comment 0 reactions 1 assignee View on GitHub

@kbattocchi is already working on this.

Since Mar 7, 2023.

Dominant language
Jupyter Notebook
Stars
4.8k
Forks
827
PR merge metrics
No merged PRs in 30d

Description

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:

  • The sample_treatment_costs would need to be multiplied by the weights (or pre-multiplied by the caller).
  • The policy_value_ and always_treat_value_ would need to be converted to weighted averages.

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.