py-why / py-why/EconML

Clarification about DML marginal_effect

Open
#747 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Thank you for such wonderful package.
I have categorical Treatment (value = 0, 1, 2) and I used DML.

The effect of the treatments is below.
image

Then I tried the marginal effect with base treatment = 0.
image

Now,
If I try other treatment value as base treatment such as 1 or 2. It does not change the output. Even whatever value I put as T, the output doesnot change.
dml_est.marginal_effect(T=1, X=dml_test_seg)
OR
dml_est.marginal_effect(T=2, X=dml_test_seg)

Am I missing something? Any help will be appreciated.

Thanks

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.

Research direction

Start at the DML estimator's marginal_effect(T, X) entry point and read its documentation and treatment encoding assumptions. Reproduce the calls with T=0, 1, and 2 using dml_test_seg, then confirm the expected behavior for categorical treatments and document or correct the differing outputs if needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.