py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.04k stars 926 forks source link

Simple constraints for the SCM #1046

Open priamai opened 12 months ago

priamai commented 12 months ago

Hi there, with reference to this: https://www.pywhy.org/dowhy/v0.10.1/example_notebooks/gcm_draw_samples.html how can we provide simple constraints to draw samples in specific use cases?

Examples of real applications: a) sales are integers positive or zero numbers b) revenue is float but positive or zero numbers c) a satisfaction rating is an integer between 0 to 10 d) a bio marker is a continuous number between 0.0 to 1.0

Hope it makes sense.

bloebp commented 12 months ago

Hey,

yes that definitely makes sense and it is currently not that straightforward to enforce these constraints beyond customizing the causal mechanisms. A similar discussion came up before here: https://github.com/py-why/dowhy/discussions/928

Definitely need to work on a way to simplify this.