ca25da7c55ba436ab557410d5f2e2e9b557d2840,pgmpy/models/MarkovModel.py,MarkovModel,to_junction_tree,#MarkovModel#,412
Before Change
clique_trees = JunctionTree(nx.minimum_spanning_tree(complete_graph).edges())
factor = self.factors[0]
factor = factor.product(*[self.factors[i] for i in
range(1, len(self.factors))])
if set(factor.scope()) != set(self.nodes()):
ValueError("Factor for all the random variables not specified")
all_vars = set(self.nodes())
for node in clique_trees.nodes():
marginalised_nodes = all_vars - set(node)
factor_copy = factor.marginalize(list(marginalised_nodes),
inplace=False)
clique_trees.add_factors(factor_copy)
return clique_trees
After Change
for factor in self.factors:
if not is_used[factor] and set(factor.scope()).issubset(node):
clique_factors.append(factor)
is_used[factor] = True
clique_potential = factor_product(*clique_factors)
clique_trees.add_factors(clique_potential)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pgmpy/pgmpy
Commit Name: ca25da7c55ba436ab557410d5f2e2e9b557d2840
Time: 2015-03-02
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/models/MarkovModel.py
Class Name: MarkovModel
Method Name: to_junction_tree
Project Name: pgmpy/pgmpy
Commit Name: a6748b7f0758aea9d2650ab2844e76c989628670
Time: 2015-08-24
Author: pratyaksh@me.com
File Name: pgmpy/inference/Sampling.py
Class Name: GibbsSampling
Method Name: _get_kernel_from_bayesian_model
Project Name: dask/dask-image
Commit Name: 58e7111d89307b9a8608b4eaa6d521d8e9ce96a3
Time: 2018-10-01
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: labeled_comprehension