Open
Description
I am working on a heart disease dataset which has continuous variable as a treatment (thalach) and outcome categorical(target).There is another variable that the treatment affects (exang) which is categorical too. They have an inverse relation i.e. when thalach is increased, exang should come down. However, it is giving invalid values (-1) of exang (0,1) when intervened on thalach, using counterfactual_samples.
samples = gcm.counterfactual_samples(causal_model, {'thalach': lambda thalach:thalach * 1.1}, observed_data=df_risk).
Before and after intervention:
Although, I have a hack by clipping values. I would like to know if there is something built in to constrain the effect of intervention.