$npx skillfedfor your agent

pgmpy

Python Toolkit for Causal and Probabilistic Reasoning

Worth itPyPI Scientific/EngineeringReleased Apr 2026957.9K downloads / moPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pgmpy-1.1.2-py3-none-any.whl
v1.1.2 · released 2026-04-30 · Python <3.15,>=3.10 · 12 runtime deps: huggingface_hub, networkx, numpy, scipy, scikit-learn, pandas, statsmodels, tqdm

Yes. pgmpy is actively maintained, has low install friction, carries no security vulnerabilities, and offers a comprehensive toolkit for causal and probabilistic reasoning with a scikit-learn-compatible API. It is suitable for research, education, and production use in causal inference and graphical modeling tasks. The MIT license imposes no restrictions.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later (supports up to 3.14).
  • All 12 runtime dependencies must be installed.
  • Low install friction with a pure-Python wheel.

License · maintenance · safety

(unclear) — Licensed under MIT with no restrictions on commercial or private use, though license treatment is marked unclear in metadata.

last release 2026-04-30 (106 days) · last repo commit 2026-08-14 · 3,313 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 957,860 downloads/mo, #4,642 on PyPI

Verify before relying

pip install pgmpy

from pgmpy.example_models import load_model
from pgmpy.estimators import PC

discrete_bn = load_model("bnlearn/alarm")
alarm_df = discrete_bn.simulate(n_samples=100)
dag = PC(data=alarm_df).estimate(ci_test="chi_square", return_type="dag")
  • Whether all 12 runtime dependencies are always required or if some are optional for specific use cases.
  • Performance characteristics or scalability limits for large graphical models.
  • Whether torch backend support (mentioned in examples) requires additional optional dependencies.
Same gist for agents: .md · .json

What it is and what it does

pgmpy is a Python toolkit for building and reasoning with causal and probabilistic graphical models. It implements data structures for DAGs, Bayesian networks, dynamic Bayesian networks, and structural equation models, along with algorithms for causal discovery, causal identification, probabilistic and causal inference, parameter estimation, model validation, and simulation.

The package provides a unified, composable API across algorithms and is scikit-learn compatible where applicable, allowing use in sklearn pipelines or as standalone tools. It handles discrete data, linear Gaussian data, and mixture models with arbitrary relationships. The library is actively maintained, supports Python 3.10 through 3.14, and depends on standard scientific Python libraries.

Use it for

  • Learn causal structure from observational data using algorithms like PC, then estimate parameters and make predictions.
  • Compute posterior distributions conditioned on observed evidence in discrete or continuous Bayesian networks.
  • Generate synthetic data under specified interventions or counterfactual scenarios using do-calculus.
  • Validate whether a proposed causal structure is compatible with observed data using metrics.
  • Build hybrid models mixing discrete and continuous variables with functional relationships.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

pgmpy is actively maintained, has low install friction, carries no security vulnerabilities, and offers a comprehensive toolkit for causal and probabilistic reasoning with a scikit-learn-compatible API. It is suitable for research, education, and production use in causal inference and graphical modeling tasks. The MIT license imposes no restrictions.

Install

pgmpy on PyPI

Before you install

Low install friction with a pure-Python wheel. Maintenance is active with a recent release and 3313 GitHub stars. Depends on 12 well-established scientific libraries including networkx, numpy, scipy, scikit-learn, pandas, and statsmodels.

Requires Python 3.10 or later (supports up to 3.14). All 12 runtime dependencies must be installed.

License in practice

Licensed under MIT with no restrictions on commercial or private use, though license treatment is marked unclear in metadata.

Quickstart

pip install pgmpy

from pgmpy.example_models import load_model
from pgmpy.estimators import PC

discrete_bn = load_model("bnlearn/alarm")
alarm_df = discrete_bn.simulate(n_samples=100)
dag = PC(data=alarm_df).estimate(ci_test="chi_square", return_type="dag")

Verify before relying

  • Whether all 12 runtime dependencies are always required or if some are optional for specific use cases.
  • Performance characteristics or scalability limits for large graphical models.
  • Whether torch backend support (mentioned in examples) requires additional optional dependencies.

Package facts

LicenseNot declared unclear
Python supportSupports the current Python release <3.15,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
12 packages
huggingface_hubnetworkxnumpyscipyscikit-learnpandasstatsmodelstqdmpyparsingjoblibopt_einsumscikit-base
MaintenanceActively maintained 106 days since the last release
Last repo commit
First released
Downloads957,860 / month, #4,642 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: EducationIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Bio-Informatics

Evidence: pgmpy-1.1.2-py3-none-any.whl

Tags

Capabilities
bayesian network inferencecausal discovery algorithmsprobabilistic graphical modelscausal inference do-calculusstructure learning from dataparameter estimation networkscounterfactual reasoning
Topics
causal-inferencegraphical-modelsprobabilistic-reasoning

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “causal discovery algorithms”

  • pgmpypgmpy provides data structures and algorithms for causal discovery,…
  • dowhyDoWhy is a Python library for causal inference that identifies and…
  • psmpyPsmPy implements propensity score matching for observational studies,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Scientific/Engineering packages

numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
pandas Worth it
PyPI · Scientific/Engineering · released Jul 2026

pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.

BSD-3-Clausecompiled wheel · 3.11+
769.1Mdownloads / mo
scipy Worth it
PyPI · Libraries · released Jun 2026

scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.

BSD-3-Clausecompiled wheel · 3.12+
449.0Mdownloads / mo
scikit-learn Worth it
PyPI · Software Development · released Jun 2026

scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.

Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.

BSD-3-Clausecompiled wheel · 3.11+
235.5Mdownloads / mo
dill Worth it
PyPI · Software Development · released Jan 2026

dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.

BSD-3-Clausepure Python · 3.9+
208.1Mdownloads / mo
multiprocess Worth it
PyPI · Software Development · released Jan 2026

Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.

Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.

BSD-3-Clausepure Python · 3.9+
202.7Mdownloads / mo

See also pyAgrum-nightly · pyjpt · dowhy · problog · causallib · causalml · pymc · tensorflow-probability · pymc3 · google-meridian