py-why / py-why/EconML

Does ForestDML support multiple binary treatments?

Open
#334 12 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

From the this webpage it reads:

"Our implementation of a Causal Forest is restricted to binary treatment or single-dimensional continuous treatment ..."

If I understand correctly, then it would work if I have multiple binary treatment? However, I tried many ways of specifying and fitting the models and had no luck.

For example, if I use
est = ForestDML(model_t = MultiOutputClassifier(RidgeClassifier()), model_y = Ridge()); est.fit(Y=Y, T=T, X=X, W=W, inference='auto')
(my X array has 2 columns and 60000 rows.; the values of this array are all boolean)
Then I got error:
This method can only be used with single-dimensional continuous treatment or binary categorical treatment.

If I use:
est = ForestDML(model_t = MultiOutputClassifier(RidgeClassifier()), model_y = Ridge(), discrete_treatment=True); est.fit(Y=Y, T=T, X=X, W=W, inference='auto')

Then I got error:
Found input variables with inconsistent numbers of samples: [60000, 120000]

So does ForestDML work for multiple binary treatments? If so, any short example or guide would be really appreciated.

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 with ForestDML's treatment validation and the linked forest documentation, then reproduce both supplied fit calls with the two-column boolean treatment input. Compare the documented binary or single-dimensional treatment constraint with the observed errors; done means establishing whether multiple binary treatments are supported and documenting or scoping the required change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
machine-learning
Issue type
Feature
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.