Python package for Causal Discovery by learning the graphical structure of Bayesian networks. Structure Learning, Parameter Learning, Inferences, Sampling methods.
The maximum likelihood estimation in parameter learning, fit(model, df, methodtype='ml', verbose=3), estimates the CPDs using MLE but then the model returned is MaximumLiklihoodEstimator not a BayesianModel class. The code needs to be modified as below in parameter_learning.py
if config['method']=='ml' or config['method']=='maximumlikelihood':
model.fit(df, estimator=None) # estimator as None makes it maximum likelihood estimator according pgmpy docs.
for cpd in model.get_cpds():
if config['verbose']>=3: print("CPD of {variable}:".format(variable=cpd.variable))
if config['verbose']>=3: print(cpd)
The maximum likelihood estimation in parameter learning, fit(model, df, methodtype='ml', verbose=3), estimates the CPDs using MLE but then the model returned is MaximumLiklihoodEstimator not a BayesianModel class. The code needs to be modified as below in parameter_learning.py