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

Before Change


            cpds = self.cpd_expr.searchString(block)
            if "table" in block:
                arr = [float(j) for i in cpds for j in i]
                arr = numpy.array(arr)
                arr = arr.reshape((len(self.variable_states[var_name]),
                                   arr.size // len(self.variable_states[var_name])))
            else:
                arr_length = numpy.prod([len(self.variable_states[var]) for var in parents])

After Change


            else:
                arr_length = np.prod([len(self.variable_states[var]) for var in parents])
                arr = np.zeros((len(self.variable_states[var_name]), arr_length))
                values_dict = {}
                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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name:


Project Name: enthought/chaco
Commit Name: 7007efb257905b96618ea2d0072a37292fdb655b
Time: 2013-05-16
Author: cwebster@enthought.com
File Name: chaco/array_plot_data.py
Class Name: ArrayPlotData
Method Name: set_data