Hi, I'm trying FLAME for the first time and encountered an error during post-processing of the ATE:
model = dame_flame.matching.FLAME(
repeats=True,
verbose=3,
adaptive_weights="decisiontree",
stop_unmatched_t=True,
early_stop_un_t_frac=0.005,
missing_holdout_replace=0,
want_pe=True,
want_bf=True,
)
model.fit(holdout_data=df, treatment_column_name="treated", outcome_column_name="outcome")
result = model.predict(df)
dame_flame.utils.post_processing.ATE(model)
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-10-b4ec8bd0f432> in <module>
----> 1 dame_flame.utils.post_processing.ATE(model)
~/Library/Caches/pypoetry/virtualenvs/pandata-ml-deal-optimisation--RFgPKiW-py3.7/lib/python3.7/site-packages/dame_flame/utils/post_processing.py in ATE(matching_object, mice_iter)
161 treated = group_data.loc[group_data[matching_object.treatment_column_name] == 1]
162 control = group_data.loc[group_data[matching_object.treatment_column_name] == 0]
--> 163 avg_treated = sum(treated[matching_object.outcome_column_name]) / len(treated.index)
164 avg_control = sum(control[matching_object.outcome_column_name]) / len(control.index)
165 cates[group_id] = avg_treated - avg_control
ZeroDivisionError: division by zero