Package: cause2e
Getting started:The easiest way of learning about cause2e's functionality and starting your own causal analyses is to check out thisexample notebook, which can be easily adapted to fit the needs of your custom analysis, and its resultingreport file. Additional notebooks with examples of more specific functionality are also provided.Overview:The cause2e package provides tools for performing anend-to-end causal analysisof your data. If you have data and domain knowledge about the data generating process, it allows you to:learn a graphical causal model of the data generating processidentify a statistical estimand for the causal effect that one variable has on another variableestimate the effect with various statistical techniquescheck the robustness of your results with respect to changes in the causal modelForanalyzing the whole system at onceafter learning the causal graph, you can use a single command tovisualize your qualitative domain knowledgeestimate all possible direct, indirect and overall causal effects between your variables via do-calculus-backed linear regressionreceive a ranking of the strongest causal effectsvisualize all causal effects in heatmapsvalidate your model against a priori known quantitative causal effectsreceive a pdf report containing all relevant informationThe main contribution of cause2e is the integration of two established causal packages that have currently been separated and cumbersome to combine:Causal discovery methodsfrom thepy-causalpackage [1], which is a Python wrapper around parts of the JavaTETRADsoftware. It provides many algorithms for learning the causal graph from data and domain knowledge.Causal reasoning methodsfrom theDoWhypackage [2], which is the current standard for the steps of a causal analysis starting from a known causal graph and data:Algebraically identifying a statistical estimand for a causal effect from the causal graph via do-calculus.Using statistical estimators to actually estimate the causal effect.Performing robustness tests to check how sensitive the estimate is to model misspecification and other errors.Structured API:cause2e provides aneasy to use APIfor performing an end-to-end causal analysis without having to worry about fitting together different libraries and data structures for causal discovery and causal reasoning:TheStructureLearnerclass for causal discovery canread and preprocess dataaccept domain knowledge in a simple data formatlearn the causal graph usingpy-causalalgorithmsvisualize the causal graph and the influence of the specified domain knowledge on the resultmanually postprocess the resulting graph in case you want to add, delete or reverse some edgescheck if the graph is acyclic and respects the domain knowledgesave the graph to various file formatsTheEstimatorclass for causal reasoning canread data and imitate the preprocessing steps applied by the StructureLearnerload the causal graph that was saved by the StructureLearnerperform the above mentioned causal reasoning steps suggested by theDoWhypackageAdditonally, cause2e offers helper classes for handling all paths to your data and output, representing domain knowledge, as well as bookkeeping, ranking, visualization and validation of the results of a multi-effect analysis.Documentation:For a detailed documentation of the package, please refer tomlresearchatosram.github.io/cause2e.
The documentation has been generated from Python docstrings viaSphinx.Outlook:We are planning to integrate thecausal discovery toolbox[3] as a second collection of causal discovery algorithms. In the spirit of end-to-end causal analysis, it would also be desirable to include causal representation learning before the discovery step (e.g. for image data), or causal reinforcement learning after having distilled a valid causal model that delivers interventional distributions.Installation:First, installpy-causalby followingthese instructions. If you run into troubles with Java on Windows, check outthis comment.You can then install cause2e from pypi:pip install cause2eYou can also install it directly from this Github repository to receive the newest version:pip install dowhy -U
pip install ipython -U
pip install jinja2 -U
pip install pillow -U
pip install pyarrow -U
pip install seaborn -U

pip install git+git://github.com/MLResearchAtOSRAM/cause2eAfterwards, try to run theminimal example notebookto check that everything works.If you want to clone the repository into a folder for development on your local machine, please navigate to the folder and run:git clone https://github.com/MLResearchAtOSRAM/cause2eDisclaimer:cause2e is not meant to replace eitherpy-causalorDoWhy, our goal is to make it easier for researchers to string together causal discovery and causal reasoning with these libraries. If you are only interested in causal discovery, it is preferable to directly usepy-causalor theTETRAD GUI. If you are only interested in causal reasoning, it is preferable to directly useDoWhy.Citation:If you are using cause2e in your work, please cite:Daniel Grünbaum (2021). cause2e: A Python package for end-to-end causal analysis.https://github.com/MLResearchAtOSRAM/cause2eReferences:[1] Chirayu (Kong) Wongchokprasitti, Harry Hochheiser, Jeremy Espino, Eamonn Maguire, Bryan Andrews, Michael Davis, & Chris Inskip. (2019, December 26). bd2kccd/py-causal v1.2.1 (Version v1.2.1). Zenodo.http://doi.org/10.5281/zenodo.3592985[2] Amit Sharma, Emre Kiciman, et al. DoWhy: A Python package for causal inference. 2019.https://github.com/microsoft/dowhy[3] Kalainathan, D., & Goudet, O. (2019). Causal Discovery Toolbox: Uncover causal relationships in Python. arXiv:1903.02278.https://github.com/FenTechSolutions/CausalDiscoveryToolbox