b384268df66742de0bc92a13db162b8409dda730,pgmpy/readwrite/BIF.py,BIFReader,get_values,#BIFReader#,218

Before Change


                    vals = [float(i) for i in prob_line[len(parents):]]
                    offset = sum((len(parents)-i)*self.variable_states[parents[i]].index(states[i])
                                 for i in range(len(states)))
                    for i, val in enumerate(vals):
                        arr[i][offset] = val
                arr = numpy.array(arr)
            variable_cpds[var_name] = arr

        return variable_cpds

After Change


                for prob_line in cpds:
                    states = prob_line[:len(parents)]
                    vals = [float(i) for i in prob_line[len(parents):]]
                    values_dict[tuple(states)] = vals
                for index, combination in enumerate(product(*[self.variable_states[var] for var in parents])):
                    arr[:, index] = values_dict[combination]
            variable_cpds[var_name] = arr

        return variable_cpds
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pgmpy/pgmpy
Commit Name: b384268df66742de0bc92a13db162b8409dda730
Time: 2019-04-19
Author: ankurankan@gmail.com
File Name: pgmpy/readwrite/BIF.py
Class Name: BIFReader
Method Name: get_values


Project Name: dit/dit
Commit Name: 608fff2119f21191352ddf5d96eb82fc1ab099b0
Time: 2013-02-25
Author: chebee7i@gmail.com
File Name: dit/utils/misc.py
Class Name:
Method Name: partitions


Project Name: MycroftAI/padatious
Commit Name: a1383be585a1798a3333139c4c1be149d3c5a454
Time: 2017-09-15
Author: matthew3311999@gmail.com
File Name: padatious/util.py
Class Name:
Method Name: resolve_conflicts