py-why / py-why/EconML

How to make predictions with models_y?

Open
#532 2 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

I have the following setup (no W variables):

est = LinearDML(model_y=LinearRegression(), model_t=LogisticRegression(max_iter=1000), discrete_treatment=True, random_state=55) 
est.fit(Y=y, T=T, X=X, W=None) 

I have 8505 observations, and 78 features in X. I am able to make predictions using models_t: est.models_t[0][0].predict(X) but I'm not able to do with with models_y. I get "ValueError: X has 78 features per sample; expecting 6162".

Why does model_y not expect 78 features? What is the correct way to format input to make predictions using models_y?

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 the LinearDML setup in the issue and read the model_y and model_t documentation or source to determine their expected prediction inputs. Document the correct input format for models_y, explain why it differs from models_t, and include a working prediction example based on the shown estimator.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.