py-why / py-why/EconML

OrthoIV example in Docs throws error

Open
#338 1 comment 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

When I try to run the OrthoIV example from the docs (https://github.com/microsoft/EconML), I am able to fit the model and obtain results using the effect method. But when I try to compute effect confidence intervals using the effect_inference method, it throws and error saying Inference = None, even though the model has already been fit?

Am I missing something? How do I resolve this issue?


AttributeError Traceback (most recent call last)
in
----> 1 lb, ub = est.effect_inference(X_test.iloc[:, 1:-2]) # OLS confidence intervals

~/pycx_kernel/.deps/econml-0.7.0-py3-none-any.whl/econml/_ortho_learner.py in effect_inference(self, X, T0, T1)
603 def effect_inference(self, X=None, *, T0=0, T1=1):
604 self._check_fitted_dims(X)
--> 605 return super().effect_inference(X, T0=T0, T1=T1)
606 effect_inference.doc = LinearCateEstimator.effect_inference.doc
607

~/pycx_kernel/.deps/econml-0.7.0-py3-none-any.whl/econml/cate_estimator.py in call(self, *args, **kwargs)
170 return getattr(self._inference, name)(*args, **kwargs)
171 else:
--> 172 raise AttributeError("Can't call '%s' because 'inference' is None" % name)
173 return call
174

AttributeError: Can't call 'effect_inference' because 'inference' is None

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

Open the OrthoIV example in the linked EconML repository and reproduce the documented fit, effect, and effect_inference calls. Start by reading the shown effect_inference path and how the estimator is configured in the example. Done means the example either computes confidence intervals successfully or documents the required configuration and expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
documentation, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.