Dowhy Econml: missing 1 required positional argument: 'y' / This estimator does not support X=None

21 views Asked by At

Please I'm trying different Econml tree based causal estimators yet I get this error for example with grf.CausalForest or grf.RegressionForest or grf.CausalIVForest,PolicyForest

model= CausalModel(
              data = GE_Profile_WGS,
              treatment='State',
              outcome='TargetGene',
              common_causes=GE_Profile_WGS.columns.to_list()[2:len(GE_Profile_WGS.columns)]
              )

dml_estimate = model.estimate_effect(identified_estimand,method_name="backdoor.econml.grf.RegressionForest",
                                method_params={"init_params":{
                                    'n_estimators':200,},                                    
                                    "fit_params":{}})

---> 63         dml_estimate = model.estimate_effect(identified_estimand, method_name="backdoor.econml.grf.CausalIVForest",
     64                                 method_params={"init_params":{
     65                                     'n_estimators':200,

2 frames
/usr/local/lib/python3.10/dist-packages/dowhy/causal_estimators/econml.py in fit(self, data, effect_modifier_names, **kwargs)
    192             arg: named_data_args[arg] for arg in named_data_args.keys() if arg in estimator_named_args
    193         }
--> 194         self.estimator.fit(**estimator_data_args, **kwargs)
    195 
    196         return self

TypeError: CausalIVForest.fit() missing 1 required positional argument: 'y'

I'm trying to calculate the estimate like I did with all the Meta-Learners but there is something weird about the tree based, also I get this error with some other estimators like ForestDRIV, CausalForestDML, ForestDRLearner

         dml_estimate = model.estimate_effect(identified_estimand, method_name="backdoor.econml.dr.ForestDRLearner",
     64                                 method_params={"init_params":{
     65                                     #'n_estimators':200,

3 frames
/usr/local/lib/python3.10/dist-packages/econml/dr/_drlearner.py in fit(self, Y, T, X, W, sample_weight, groups, cache_values, inference)
   1650         """
   1651         if X is None:
-> 1652             raise ValueError("This estimator does not support X=None!")
   1653 
   1654         return super().fit(Y, T, X=X, W=W,

ValueError: This estimator does not support X=None!
0

There are 0 answers