causalnex

A Python library that helps data scientists to infer causation rather than observing correlation.

https://github.com/mckinsey/causalnex

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 38 committers (2.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary

Keywords

bayesian-inference bayesian-networks causal-inference causal-models causal-networks causalnex data-science machine-learning

Keywords from Contributors

data-profilers datacleaner pipeline-testing mlops
Last synced: 6 months ago · JSON representation ·

Repository

A Python library that helps data scientists to infer causation rather than observing correlation.

Basic Info
Statistics
  • Stars: 2,364
  • Watchers: 50
  • Forks: 268
  • Open Issues: 35
  • Releases: 20
Topics
bayesian-inference bayesian-networks causal-inference causal-models causal-networks causalnex data-science machine-learning
Created about 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

CausalNex


| Theme | Status | |------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Latest Release | PyPI version | | Python Version | Python Version | | master Branch Build | CircleCI | | develop Branch Build | CircleCI | | Documentation Build | Documentation | | License | License | | Code Style | Code Style: Black |

What is CausalNex?

"A toolkit for causal reasoning with Bayesian Networks."

CausalNex aims to become one of the leading libraries for causal reasoning and "what-if" analysis using Bayesian Networks. It helps to simplify the steps: - To learn causal structures, - To allow domain experts to augment the relationships, - To estimate the effects of potential interventions using data.

Why CausalNex?

CausalNex is built on our collective experience to leverage Bayesian Networks to identify causal relationships in data so that we can develop the right interventions from analytics. We developed CausalNex because:

  • We believe leveraging Bayesian Networks is more intuitive to describe causality compared to traditional machine learning methodology that are built on pattern recognition and correlation analysis.
  • Causal relationships are more accurate if we can easily encode or augment domain expertise in the graph model.
  • We can then use the graph model to assess the impact from changes to underlying features, i.e. counterfactual analysis, and identify the right intervention.

In our experience, a data scientist generally has to use at least 3-4 different open-source libraries before arriving at the final step of finding the right intervention. CausalNex aims to simplify this end-to-end process for causality and counterfactual analysis.

What are the main features of CausalNex?

The main features of this library are:

  • Use state-of-the-art structure learning methods to understand conditional dependencies between variables
  • Allow domain knowledge to augment model relationship
  • Build predictive models based on structural relationships
  • Fit probability distribution of the Bayesian Networks
  • Evaluate model quality with standard statistical checks
  • Simplify how causality is understood in Bayesian Networks through visualisation
  • Analyse the impact of interventions using Do-calculus

How do I install CausalNex?

CausalNex is a Python package. To install it, simply run:

bash pip install causalnex

Use all for a full installation of dependencies: bash pip install "causalnex[all]"

See more detailed installation instructions, including how to setup Python virtual environments, in our installation guide and get started with our tutorial.

How do I use CausalNex?

You can find the documentation for the latest stable release here. It explains:

Note: You can find the notebook and markdown files used to build the docs in docs/source.

Can I contribute?

Yes! We'd love you to join us and help us build CausalNex. Check out our contributing documentation.

How do I upgrade CausalNex?

We use SemVer for versioning. The best way to upgrade safely is to check our release notes for any notable breaking changes.

How do I cite CausalNex?

You may click "Cite this repository" under the "About" section of this repository to get the citation information in APA and BibTeX formats.

What licence do you use?

See our LICENSE for more detail.

We're hiring!

Do you want to be part of the team that builds CausalNex and other great products at QuantumBlack? If so, you're in luck! QuantumBlack is currently hiring Machine Learning Engineers who love using data to drive their decisions. Take a look at our open positions and see if you're a fit.

Owner

  • Name: McKinsey & Company
  • Login: mckinsey
  • Kind: organization

We are a global management consulting firm and a trusted advisor to the world's leading businesses, governments, and institutions.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you'd like to cite CausalNex, please use the following metadata"
authors:
- family-names: "Beaumont"
  given-names: "Paul"
- family-names: "Horsburgh"
  given-names: "Ben"
- family-names: "Pilgerstorfer"
  given-names: "Philip"
- family-names: "Droth"
  given-names: "Angel"
- family-names: "Oentaryo"
  given-names: "Richard"
- family-names: "Ler"
  given-names: "Steven"
- family-names: "Nguyen"
  given-names: "Hiep"
- family-names: "Ferreira"
  given-names: "Gabriel Azevedo"
- family-names: "Patel"
  given-names: "Zain"
- family-names: "Leong"
  given-names: "Wesley"
title: "CausalNex"
date-released: 2021-10-15
url: "https://github.com/quantumblacklabs/causalnex"

GitHub Events

Total
  • Issues event: 2
  • Watch event: 135
  • Issue comment event: 2
  • Fork event: 15
Last Year
  • Issues event: 2
  • Watch event: 135
  • Issue comment event: 2
  • Fork event: 15

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 183
  • Total Committers: 38
  • Avg Commits per committer: 4.816
  • Development Distribution Score (DDS): 0.787
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Philip Pilgerstorfer 3****p 39
Gabriel Azevedo Ferreira 5****B 30
Richard Oentaryo o****j 22
Angel Droth 6****b 21
Ben Horsburgh B****h@q****m 14
stevelersl 5****B 6
Zain Patel z****l@q****m 5
hiepnguyen034 h****n@q****m 4
philip_pilgerstorfer p****!@q****m 3
Leon Nallamuthu 3****u 3
Viktoriia Oliinyk 4****k 3
Snyk bot s****t@s****o 2
Deepyaman Datta d****a@u****u 2
ElisabethSesterHussQB 9****B 2
Hector h****l@g****m 2
Paul Beaumont 3****b 2
Richard Kang - SIO 1****c 2
tsanikgr n****s@q****m 1
Gabriel Azevedo g****a@m****m 1
Xupeng (Tony) Tong t****u@g****m 1
Wesley Leong 3****g 1
Tim Herfurth t****7@g****m 1
Shuhei Ishida s****6@g****m 1
Serene Yeo 1****o 1
Sami Alabed 6****d 1
RyanNgQB 7****B 1
Rishab26 r****6@g****m 1
Liam Adams 7****s 1
KING-SID s****2@g****m 1
Jiří Němeček c****t@n****z 1
and 8 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 93
  • Total pull requests: 80
  • Average time to close issues: 9 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 47
  • Total pull request authors: 18
  • Average comments per issue: 1.61
  • Average comments per pull request: 0.6
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 1
  • Average time to close issues: 3 days
  • Average time to close pull requests: N/A
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • blacksnail789521 (2)
  • luk-fer (1)
  • yc-um (1)
  • RuikeZ (1)
  • pengDLDG (1)
  • ziyuwzf (1)
  • elisammz (1)
  • dariodandrea (1)
  • koaning (1)
  • HLouy (1)
  • kedarthakar (1)
  • matteomoretti-aily (1)
  • klai001 (1)
  • mohammadoshanreh (1)
Pull Request Authors
  • leonnallamuthu (22)
  • pjbqb (2)
  • snyk-bot (2)
  • yukudemy (2)
  • dariodandrea (2)
  • ViktoriiaOliinyk (1)
  • Epanemu (1)
  • kianmeng (1)
  • abdelghanibelgaid (1)
Top Labels
Issue Labels
bug (8) enhancement (3)
Pull Request Labels
documentation (1)

Dependencies

doc_requirements.txt pypi
  • Markupsafe <2.1
  • click >=7.0,<8.0
  • ipykernel >=4.8.1,<5.0
  • ipython_genutils >=0.2.0
  • jinja2 >=2.3,<3.0
  • jupyter_client >=5.1,<7.0
  • nbconvert >=5.0,<6.0
  • nbsphinx ==0.4.2
  • nbstripout ==0.3.3
  • patchy >=1.5,<2.0
  • pydot >=1.4,<2.0
  • pygments >=2.6.1,<3.0
  • pygraphviz >=1.5,<2.0
  • recommonmark >=0.5.0,<1.0
  • sphinx >=3.0.4,<4.0
  • sphinx-autodoc-typehints >=1.6.0,<2.0
  • sphinx-markdown-tables >=0.0.15,<1.0
  • sphinx_copybutton >=0.2.5,<1.0
  • sphinx_rtd_theme >=0.4.3,<1.0
requirements.txt pypi
  • networkx *
  • numpy >=1.14.2,<2.0
  • pandas >=1.0,<2.0
  • pathos >=0.2.7,<0.3.0
  • pgmpy >=0.1.12,<0.2.0
  • scikit-learn >=0.22.0,<0.25.0,
  • scikit-learn >=0.24.0,<0.25.0,
  • scipy >=1.2.0,<1.7
  • torch >=1.7,<2.0
  • wrapt >=1.11.0,<1.13
test_requirements.txt pypi
  • Cython >=0.29,<1.0
  • flake8 >=3.5,<4.0
  • ipython >=7.0,<7.17
  • isort >=4.3.16,<5.0
  • matplotlib *
  • mdlp-discretization *
  • mock >=2.0.0,<3.0
  • pre-commit >=2.9.2
  • pygraphviz >=1.5,<2.0
  • pylint >=2.7.2,<3.0
  • pytest >=4.3.0,<5.0
  • pytest-cov >=2.5,<3.0
  • pytest-mock >=1.7.1,<2.0
  • scikit-learn >=0.24.2
setup.py pypi