mckinsey / causalnex

A Python library that helps data scientists to infer causation rather than observing correlation.
http://causalnex.readthedocs.io/
Other
2.24k stars 258 forks source link

Regarding Do intervention on values other than the training set #165

Closed AizazSharif closed 2 years ago

AizazSharif commented 2 years ago

Hi,

I have been using Causalnex library over the past month in my PhD and its amazing even with large number of features. I am currently exploring Inference engine for do-intervention step and I realized that you can only intervene on values that already exists in the CPD of Bayesian model.

Is there any method to perform counterfactual reasoning on unknown data (closer to the training data values) which we want to use for do-intervention? Any help or suggestion would be appreciated.

GabrielAzevedoFerreiraQB commented 2 years ago

Hi @AizazSharif , and thanks for the question!

Indeed, since CausalNex works with a discretised version of the data (see the discretisation methods here ), The Bayesian Model can't evaluate a value that is not present in the training data.

There are alternatives to this:

I hope it helps!

oentaryorj commented 2 years ago

Closing this issue for now. Feel free to re-open should there be further question