Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.1.26] - 2024-08-09
Added
- Support for returning Belief Propagation messages in Factor Graph BP.
- Maximum Likelihood Estimator for Junction Tree.
- Adds a simple discretization method:
pgmpy.utils.discretize. - Two new metrics for model testing:
pgmpy.metrics.implied_cisandpgmpy.metrics.fisher_c. - Support for Linear Gaussian Bayesian Networks: estimation, prediction, simulation and random model generation.
- New mixed data Conditional Independence test based on canonical correlations.
- New LLM based structure learning / causal discovery algorithm. Also LLM based pairwise variable orientation method.
Fixed
- Reading and Writing from XBN file format.
- Documentation for plotting models.
- Fixes PC algorithm to add disconnected nodes in the final model.
- Allows
.in variables names in BIF file format.
Changed
- Allows
virtual_evidenceparameter in inference methods to accept DiscreteFactor objects.
[0.1.25] - 2024-03-08
Added
init_cpdsargument toExpecattionMaximiation.get_parametersto specify initialization values.- BeliefPropagation with message passing for Factor Graphs.
- Marginal Inference for undirected graphs.
Fixed
- Incompatibality with networkx==3.2.
CausalInference.get_minimal_adjustment_setto accept string variable names.- Bug in EM when latent varaibles are present.
compat_fns.copyto consider the case when int or float is passed.- Fixes issue with
BayesianNetwork.fit_updatewhen running with CUDA backend.
Changed
- Documentation Updates
- Optimizations for Hill Climb Search algorithm.
- Tests shutdown parallel workers in teardown.
- Removes the
complete_samples_onlyargument fromBaseEstimator.state_counts. - Default number of cores to use changed to 1 for parameter estimation methods.
[0.1.24] - 2023-06-30
Added
- Added support for python 3.11.
- Adds
DAG.to_graphvizandPDAG.to_graphvizmethods to convert model to graphviz objects. - Adds pytorch as an alternative backend.
- Adds unicode support for BIFReader.
Fixed
- Warnings use a logger instance.
- Fixes documentation.
- Fixes variables name arguments for
CausalInference.get_minimal_adjustment_set
Changed
- Adds argument to specify samples for ApproxInference.
- Memory optimizations for computing structure scores.
- Switches joblib backed to loky.
- Runtime optimizations for sampling.
- Runtime optimizations for Variable Elimination.
- All config variables moved to
pgmpy.global_vars.
[0.1.23] - 2023-06-30
Added
- BIFReader made compatible with the output of PyAgrum
- Support for all available CI tests in PC algorithm.
- References for read/write file formats.
Removed
- Removes
DAG.to_pdagmethod.
Changed
- Fixes for ApproxInference for DBNs.
- Make
xml.etreethe default parser instead of using lxml.
[0.1.22] - 2023-04-08
Added
- AIC score metric from score based structure learning.
- Adds support for NET (HUGIN) file format.
- Adds argument reindex to
state_countsmethod.
Fixed
- Bug in GibbsSampling when sampling from Bayesian Networks.
- Fix seed for all simulation methods.
- Memory leaks when using
lru_cache.
Changed
- Caching disabled for computing state name counts during structure learning.
- Pre-computation for sampling methods are optimized.
[0.1.21] - 2022-12-31
Added
BayesianNetwork.get_state_probabilitymethod to compute the probability of a given evidence.BayesianEstimator.estimate_cpdaccepts weighted datasets.
Fixed
- Fixes bug in
CausalInference.estimate_atewith front-door criterion. - Fixes inference bugs when variable has a single state.
[0.1.20] - 2022-09-30
Added
BayesianNetwork.get_random_cpdsmethod to randomly parameterize a network structure.- Faster Variable Elimination using tensor contraction.
factors.factor_sum_productmethod for faster sum-product operations using tensor contraction.
Fixed
- Bug in
DynamicBayesianNetwork.initialize_initial_state. #1564 - Bug in
factors.factor_product. #1565
Changed
- Runtime improvements in
DiscreteFactor.marginalizeandDiscreteFactor.copymethods.
[0.1.19] - 2022-06-30
Added
- Adds checks for arguments to
BayesianNetwork.simulatemethod.
Fixed
- Fixes TAN algorithm to use conditional information metric.
- Speed ups for all estimation and inference methods.
- Fix in stable variant of PC algorithm to give reproducible results.
- Fix in
GibbsSamplingfor it to work with variables with integral names. DAG.active_trail_nodesallows tuples as variable names.- Fixes CPD and edge creation in
UAIReader.
[0.1.18] - 2022-03-30
Fixed
- Fixes
CausalInference.is_valid_backdoor_adjustment_setto accept str arguments forZ. - Fixes
BayesianNetwork.remove_cpdto work with integral node names. - Fixes
MPLP.map_queryto return the variable states instead of probability values. - Fixes BIFWriter to generate output in standard BIF format.
[0.1.17] - 2021-12-30
Added
- Adds BayesianNetwork.states property to store states of all the variables.
- Adds extra checks in check model for state names
Fixed
- Fixes typos in BayesianModel deprecation warning
- Bug fix in printing Linear Gaussian CPD
- Update example notebooks to work on latest dev.
[0.1.16] - 2021-09-30
Added
- Adds a
fit_updatemethod toBayesianNetworkfor updating model using new data. - Adds
simulatemethod toBayesianNetworkandDynamicBayesianNetworkto simulated data under different conditions. - Adds
DynamicBayesianNetwork.fitmethod to learn model paramters from data. ApproxInferenceclass to do approximate inference on models using sampling.- Robust tests for all sampling methods.
- Adds
BayesianNetwork.loadandBayesianNetwork.saveto quickly read and write files.
Changed
BayesianModelandMarkovModelrenamed toBayesianNetworkandMarkovNetworkrespectively.- The default value of node position in
DAG.to_daftmethod. - Documentation updated on the website.
Fixed
- Fixes bug in
DAG.is_iequivalentmethod. - Automatically truncate table when CPD is too large.
- Auto-adjustment of probability values when they don't exactly sum to 1.
- tqdm works both in notebooks and terminal.
- Fixes bug in
CausalInference.querymethod.
[0.1.15] - 2021-06-30
Added
- Adds network pruning for inference algrithms to reduce the size of network before running inference.
- Adds support for latent variables in DAG and BayesianModel.
- Parallel implementation for parameter estimation algorithms.
- Adds
DAG.get_randomandBayesianModel.get_randommethods to be able to generate random models. - Adds
CausalInference.querymethod for doing do operation inference with or without adjustment sets. - Adds functionality to treesearch to do auto root and class node selection (#1418)
- Adds option to specify virtual evidence in bayesian network inference.
- Adds Expectation-Maximization (EM) algorithm for parameter estimation in latent variable models.
- Add
BDeuScoreas another option for structure score when using HillClimbSearch. - Adds CausalInference.get_minimal_adjustment_set` for finding adjustment sets.
Changed
- Renames
DAG.is_active_trailtois_dconnected. DAG.docan accept multiple variables in the argument.- Optimizes sampling methods.
- CI moved from travis and appveyor to github actions.
- Drops support for python 3.6. Requires 3.7+.
Fixed
- Example model files were not getting included in the pypi and conda packages.
- The order of values returned by CI tests was wrong. #1403
- Adjusted and normalized MI wasn't working properly in TreeSearch.
- #1423: Value error in bayesian estimation.
- Fixes bug in
DiscreteFactor.__eq__to also consider the state names order.
[0.1.14] - 2021-03-31
Added
- Adds support for python 3.9.
BayesianModelProbabilityclass for calculating pmf for BNs.- BayesianModel.predict has a new argument
stochasticwhich returns stochastic results instead of MAP. - Adds new method pgmpy.base.DAG.to_daft to easily convert models into publishable plots.
Changed
pgmpy.utils.get_example_modelnow doesn't need internet connection to work. Files moved locally.
Fixed
- Latex output of
pgmpy.DAG.get_independencies. - Bug fix in PC algorithm as it was skipping some combinations.
- Error in sampling because of seed not correctly set.
[0.1.13] - 2020-12-30
Added
- New conditional independence tests for discrete variables
Changed
- Adds warning in BayesianEstimator when using dirichlet prior.
Fixed
- Bug in
PC.skeleton_to_pdag. - Bug in
HillClimbSearchwhen no legal operations.
Removed
[0.1.12] - 2020-09-30
Added
- PC estimator with original, stable, and parallel variants.
- PDAG class to represent partially directed DAGs.
pgmpy.utils.get_example_modelfunction to fetch models from bnlearn repository.- Refactor HillClimbSearch with a new feature to specify fixed edges in the model.
- Adds a global
SHOW_PROGRESSvariable. - Adds Chow-Liu structure learning algorithm.
- Add
pgmpy.utils.get_example_modelto fetch models from bnlearn's repository. - Adds
get_valueandset_valuemethod toDiscreteFactorto get/set a single value. - Adds
get_acestral_graphtoDAG.
Changed
- Refactors ConstraintBasedEstimators into PC with a lot of general improvements.
- Improved (faster, new arguments) indepenedence tests with changes in argument.
- Refactors
sample_discretemethod. Sampling algorithms much faster. - Refactors
HillClimbSearchto be faster. - Sampling methods now return dataframe of type categorical.
Fixed
Removed
Dataclass.
[0.1.11] - 2020-06-30
Added
- New example notebook: Alarm.ipynb
- Support for python 3.8
- Score Caching support for scoring methods.
Changed
- Code quality check moved to codacy from landscape
- Additional parameter
max_ci_varsforConstraintBasedEstimator. - Additional parameter
pseudo_countfor K2 score. - Sampling methods return state names instead of number when available.
- XMLBIFReader and BIFReader not accepts argument for specifying state name type.
Fixed
- Additional checks for TabularCPD values shape.
DiscreteFactor.reduceaccepts both state names and state numbers for variables.BeliefPropagation.queryfixed to return normalized CPDs.- Bug in flip operation in
HillClimbSearch. - BIFWriter to write the state names to file if available.
BayesianModel.to_markov_modelfixed to work with disconnected graphs.- VariableElimination fixed to not ignore identifical factors.
- Fixes automatic sorting of state names in estimators.
Removed
- No support for ProbModelXML file format.
[0.1.10] - 2020-01-22
Added
- Documentation updated to include Structural Equation Models(SEM) and Causal Inference.
- Adds Mmhc estimator.
Changed
- BdeuScore is renamed to BDeuScore.
- Refactoring of NaiveBayes
- Overhaul of CI and setup infrastructure.
- query methods check for common variabls in variable and evidence argument.
Fixed
- Example notebooks for Inference.
- DAG.moralize gives consistent results for disconnected graphs.
- Fixes problems with XMLBIF and BIF reader and writer classes to be consistent.
- Better integration of state names throughout the package.
- Improves remove_factors and add_factors methods of FactorGraph
- copy method of TabularCPD and DiscreteFactor now makes a copy of state names.
Removed
- six not a dependency anymore.