py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.04k stars 926 forks source link

Hanging when refuting right after calculating confidence interval #1064

Closed whikwon closed 10 months ago

whikwon commented 11 months ago

I encountered a problem in the the tutorial notebook when I calculate the confidence interval(CI) and perform the refutation.

The code I used is like below.

from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LassoCV
from sklearn.ensemble import GradientBoostingRegressor
from econml.inference import BootstrapInference
dml_estimate = model.estimate_effect(identified_estimand, 
                                     method_name="backdoor.econml.dml.DML",
                                     target_units = "ate",
                                     confidence_intervals=True,
                                     method_params={"init_params":{'model_y':GradientBoostingRegressor(),
                                                              'model_t': GradientBoostingRegressor(),
                                                              "model_final": LassoCV(fit_intercept=False), 
                                                              'featurizer':PolynomialFeatures(degree=1, include_bias=True)},
                                               "fit_params":{
                                                               'inference': BootstrapInference(n_bootstrap_samples=100, n_jobs=-1),
                                                            }
                                              })
print(dml_estimate)

# IV. Refute the obtained estimate using multiple robustness checks.
refute_placebo_treatment = model.refute_estimate(
    identified_estimand, dml_estimate,
    method_name="placebo_treatment_refuter"
)
print(refute_placebo_treatment)

After calculating CI, it seems like refutation takes a very long time. Is this the expected outcome, or do I need to make some additional settings after calculating CI?

Version information:

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale.