53bc1480e10f6594574850a05e20b3616d904dfe,pgmpy/inference/base.py,Inference,__init__,#Inference#Any#,50

Before Change



        elif isinstance(model, MarkovModel):
            self.factors = {}
            for factor in model.get_factors():

                if not set(factor.variables.keys()).issubset(set(self.variables)):
                    raise ValueError("Factors are not consistent with the model")

                for index in range(len(factor.variables)):
                    self.cardinality[list(factor.variables.keys())[index]] = factor.cardinality[index]

                for var in factor.variables:
                    try:
                        self.factors[var].append(factor)
                    except KeyError:
                        self.factors[var] = [factor]

After Change


    def __init__(self, model):
        self.variables = model.nodes()
        self.cardinality = {}
        self.factors = defaultdict(list)

        model.check_model()

        if isinstance(model, BayesianModel):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: pgmpy/pgmpy
Commit Name: 53bc1480e10f6594574850a05e20b3616d904dfe
Time: 2014-12-21
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/inference/base.py
Class Name: Inference
Method Name: __init__


Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: _get_colexifications_by_taxa


Project Name: kmike/pymorphy2
Commit Name: c4537a1a3f223b5129862ae41f1fa955fc6acff9
Time: 2012-11-23
Author: kmike84@gmail.com
File Name: pymorphy2/tagset.py
Class Name: OpencorporaTag
Method Name: _init_restrictions


Project Name: googledatalab/pydatalab
Commit Name: 7a5f3c1751bc31f0bd5406bab04845461dd8c88a
Time: 2017-08-08
Author: qimingj@users.noreply.github.com
File Name: google/datalab/ml/_summary.py
Class Name: Summary
Method Name: list_events