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.

Home Page:https://www.pywhy.org/dowhy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

backdoor.propensity_score_weighting - pass options to LogisticRegression

fraseriainlewis opened this issue · comments

Hi, can you please advise how to pass options to LogisticRegression in backdoor.propensity_score_weighting. Specifically, I want to pass penalty='none' to LogisticRegression I tried the code below but it does not change the penalty to none - can you help? I tried kwargs but could not seem to pass this. Not sure how/where this should go in the code below.

causal_estimate_ipw = model.estimate_effect(identified_estimand, method_name="backdoor.propensity_score_weighting", target_units = "ate", method_params={"weighting_scheme":"ips_weight", "propensity_score_model":LogisticRegression(penalty='none')} )

N.b. a reason for passing penalty='none' is that using an 'l2' penalty for a logistic regression seems unusual? This is different from the behaviour of statsmodels, and I was trying to work out why dowhy was giving me different propensity scores from using statsmodels.

Version information:
dowhy-0.10.1

thanks a lot!

my fault, this does work, just needs dataset cleared before each call.