dowhy icon indicating copy to clipboard operation
dowhy copied to clipboard

estimate_effect() got an unexpected keyword argument 'num_quantiles_to_discretize_cont_cols'

Open fraseriainlewis opened this issue 2 years ago • 1 comments

Hi, I am trying to set num_quantiles_to_discretize_cont_cols and am getting the error below. This option appears in the docs but does not seem recognized? It looks like the default value = 5 from the source. I can manually categorize the continuous variables but will the method then re-allocate them into 5 quantiles regardless? thanks.

estimate_effect() got an unexpected keyword argument 'num_quantiles_to_discretize_cont_cols'

causal_estimate_reg = model.estimate_effect(identified_estimand, method_name="backdoor.generalized_linear_model", method_params={'glm_family':sm.families.Binomial(link=sm.families.links.Logit())}, test_significance=False, confidence_intervals=False, num_quantiles_to_discretize_cont_cols=10)

Version information:

  • DoWhy version 0.10.1

Additional context I am also getting similar error with other arguments passed to this method, e.g. sample_size_fraction.

fraseriainlewis avatar Sep 18 '23 11:09 fraseriainlewis

Hi, just wondering if the parameters you refer to should not be part of the method_params, i.e:

causal_estimate_reg = model.estimate_effect(identified_estimand, method_name="backdoor.generalized_linear_model", method_params={'glm_family':sm.families.Binomial(link=sm.families.links.Logit()), 'test_significance':False, 'confidence_intervals':False, "num_quantiles_to_discretize_cont_cols":10})

MichaelMarien avatar Jun 28 '24 20:06 MichaelMarien