7281b68353fa8f9263e071716ac5081df5168f59,pgmpy/inference/ExactInference.py,VariableElimination,_variable_elimination,#VariableElimination#Any#Any#Any#Any#,9

Before Change


            return set(all_factors)

        eliminated_variables = set()
        working_factors = {node: [factor for factor in self.factors[node]]
                           for node in self.factors}

        // TODO: Modify it to find the optimal elimination order

After Change


        // Dealing with evidence. Reducing factors over it before VE is run.
        for evidence_var in evidence:
            for factor in working_factors[evidence_var]:
                factor_reduced = factor.reduce("{evidence_var}_{state}".format(
                    evidence_var=evidence_var, state=evidence[evidence_var]), inplace=False).normalize()
                for var in factor_reduced.scope():
                    working_factors[var].remove(factor).add(factor_reduced)

        // TODO: Modify it to find the optimal elimination order
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pgmpy/pgmpy
Commit Name: 7281b68353fa8f9263e071716ac5081df5168f59
Time: 2015-02-01
Author: ankurankan@gmail.com
File Name: pgmpy/inference/ExactInference.py
Class Name: VariableElimination
Method Name: _variable_elimination


Project Name: pgmpy/pgmpy
Commit Name: b411c5c481759a0135fb039c954e3de1bcac23d5
Time: 2017-04-04
Author: ankurankan@gmail.com
File Name: pgmpy/factors/continuous/ContinuousFactor.py
Class Name: ContinuousFactor
Method Name: normalize


Project Name: pantsbuild/pants
Commit Name: 0f4d5b5c067ac7c5b9023d25dbb743b0470ef65a
Time: 2012-02-16
Author: jsirois@twitter.com
File Name: src/python/twitter/pants/tasks/junit_run.py
Class Name: JUnitRun
Method Name: calculate_tests