bnlearn

Python package for Causal Discovery by learning the graphical structure of Bayesian networks. Structure Learning, Parameter Learning, Inferences, Sampling metho

What is bnlearn?

Python package for Causal Discovery by learning the graphical structure of Bayesian networks. Structure Learning, Parameter Learning, Inferences, Sampling methods.

Overview of bnlearn

What it is

bnlearn is a Python package for causal discovery by learning the graphical structure of Bayesian networks. It provides pipelines for structure learning, parameter learning, inference, and sampling methods.

Key features

  • Structure learning from data or with expert knowledge
  • Parameter learning to estimate conditional probability distributions
  • Causal inference for interventional and counterfactual distributions
  • Generate synthetic data using Bayesian sampling
  • Discretize continuous datasets for Bayesian network modelling
  • Support for discrete, continuous, and mixed datasets
  • Compare causal discovery libraries and benchmark LLMs against Bayesian methods

Use cases

bnlearn can be used for causal discovery, making causal predictions, exploring interventions, computing edge strength, imputing missing data, and comparing network structures. It is suitable for researchers and practitioners working with Bayesian networks and causal modelling.

Getting started

Python 3.10 or newer is required.Installation using pip:pip install bnlearnInstallation using uv:uv venv.venv/Scripts/activateuv pip install bnlearnInstallation from GitHub source:pip install git+https://github.com/erdogant/bnlearnAfter installation, import the library:import bnlearn as bn

License and pricing

The license is not stated in the provided metadata or README.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/erdogantbnlearn.svg)](https://yunodb.com/tools/erdogantbnlearn?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/erdogantbnlearn?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/erdogantbnlearn.svg" alt="Featured on YunoDB" height="20"></a>