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.
BayesianNetwork.get_state_probability
method to compute the probability of a given evidence.BayesianEstimator.estimate_cpd
accepts weighted datasets.
- Fixes bug in
CausalInference.estimate_ate
with front-door criterion. - Fixes inference bugs when variable has a single state.
BayesianNetwork.get_random_cpds
method to randomly parameterize a network structure.- Faster Variable Elimination using tensor contraction.
factors.factor_sum_product
method for faster sum-product operations using tensor contraction.
- Bug in
DynamicBayesianNetwork.initialize_initial_state
. #1564 - Bug in
factors.factor_product
. #1565
- Runtime improvements in
DiscreteFactor.marginalize
andDiscreteFactor.copy
methods.
- Adds checks for arguments to
BayesianNetwork.simulate
method.
- 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
GibbsSampling
for it to work with variables with integral names. DAG.active_trail_nodes
allows tuples as variable names.- Fixes CPD and edge creation in
UAIReader
.
- Fixes
CausalInference.is_valid_backdoor_adjustment_set
to accept str arguments forZ
. - Fixes
BayesianNetwork.remove_cpd
to work with integral node names. - Fixes
MPLP.map_query
to return the variable states instead of probability values. - Fixes BIFWriter to generate output in standard BIF format.
- Adds BayesianNetwork.states property to store states of all the variables.
- Adds extra checks in check model for state names
- Fixes typos in BayesianModel deprecation warning
- Bug fix in printing Linear Gaussian CPD
- Update example notebooks to work on latest dev.
- Adds a
fit_update
method toBayesianNetwork
for updating model using new data. - Adds
simulate
method toBayesianNetwork
andDynamicBayesianNetwork
to simulated data under different conditions. - Adds
DynamicBayesianNetwork.fit
method to learn model paramters from data. ApproxInference
class to do approximate inference on models using sampling.- Robust tests for all sampling methods.
- Adds
BayesianNetwork.load
andBayesianNetwork.save
to quickly read and write files.
BayesianModel
andMarkovModel
renamed toBayesianNetwork
andMarkovNetwork
respectively.- The default value of node position in
DAG.to_daft
method. - Documentation updated on the website.
- Fixes bug in
DAG.is_iequivalent
method. - 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.query
method.
- 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_random
andBayesianModel.get_random
methods to be able to generate random models. - Adds
CausalInference.query
method 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
BDeuScore
as another option for structure score when using HillClimbSearch. - Adds CausalInference.get_minimal_adjustment_set` for finding adjustment sets.
- Renames
DAG.is_active_trail
tois_dconnected
. DAG.do
can 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+.
- 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.
- Adds support for python 3.9.
BayesianModelProbability
class for calculating pmf for BNs.- BayesianModel.predict has a new argument
stochastic
which returns stochastic results instead of MAP. - Adds new method pgmpy.base.DAG.to_daft to easily convert models into publishable plots.
pgmpy.utils.get_example_model
now doesn't need internet connection to work. Files moved locally.
- 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.
- New conditional independence tests for discrete variables
- Adds warning in BayesianEstimator when using dirichlet prior.
- Bug in
PC.skeleton_to_pdag
. - Bug in
HillClimbSearch
when no legal operations.
- PC estimator with original, stable, and parallel variants.
- PDAG class to represent partially directed DAGs.
pgmpy.utils.get_example_model
function to fetch models from bnlearn repository.- Refactor HillClimbSearch with a new feature to specify fixed edges in the model.
- Adds a global
SHOW_PROGRESS
variable. - Adds Chow-Liu structure learning algorithm.
- Add
pgmpy.utils.get_example_model
to fetch models from bnlearn's repository. - Adds
get_value
andset_value
method toDiscreteFactor
to get/set a single value. - Adds
get_acestral_graph
toDAG
.
- Refactors ConstraintBasedEstimators into PC with a lot of general improvements.
- Improved (faster, new arguments) indepenedence tests with changes in argument.
- Refactors
sample_discrete
method. Sampling algorithms much faster. - Refactors
HillClimbSearch
to be faster. - Sampling methods now return dataframe of type categorical.
Data
class.
- New example notebook: Alarm.ipynb
- Support for python 3.8
- Score Caching support for scoring methods.
- Code quality check moved to codacy from landscape
- Additional parameter
max_ci_vars
forConstraintBasedEstimator
. - Additional parameter
pseudo_count
for K2 score. - Sampling methods return state names instead of number when available.
- XMLBIFReader and BIFReader not accepts argument for specifying state name type.
- Additional checks for TabularCPD values shape.
DiscreteFactor.reduce
accepts both state names and state numbers for variables.BeliefPropagation.query
fixed to return normalized CPDs.- Bug in flip operation in
HillClimbSearch
. - BIFWriter to write the state names to file if available.
BayesianModel.to_markov_model
fixed to work with disconnected graphs.- VariableElimination fixed to not ignore identifical factors.
- Fixes automatic sorting of state names in estimators.
- No support for ProbModelXML file format.
- Documentation updated to include Structural Equation Models(SEM) and Causal Inference.
- Adds Mmhc estimator.
- 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.
- 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.
- six not a dependency anymore.