33a33b24185e45478c4758ac14cab8ae5234c44b,pgmpy/inference/base_continuous.py,AbstractGaussian,get_val,#AbstractGaussian#Any#,50

Before Change


        --------
        float : Value of the distribution at X
        
        if not isinstance(X, np.matrix):
            if isinstance(X, (np.ndarray, list, tuple, set, frozenset)):
                X = np.matrix(X)
                X = np.reshape(X, (1, len(X)))
            else:
                raise TypeError("mean_vec should be a 1d array type object")
        X = np.reshape(X, (len(X), 1))
        sub_vec = X - self.mean_vec
        n = len(sub_vec)
        return float(np.exp(-0.5 * sub_vec.transpose() * self.precision_matrix * sub_vec) /
                     (2 * np.pi) ** (n * 0.5) * np.linalg.det(self.cov_matrix) ** 0.5)

After Change


        --------
        float : Value of the distribution at X
        
        if isinstance(X, (np.matrix, np.ndarray, list, tuple, set, frozenset)):
            X = np.array(X).flatten()
            X = np.matrix(np.reshape(X, (len(X), 1)))
        else:
            raise TypeError("X should be a 1d array type object")
        sub_vec = X - self.mean_vec
        n = len(sub_vec)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: pgmpy/pgmpy
Commit Name: 33a33b24185e45478c4758ac14cab8ae5234c44b
Time: 2016-06-17
Author: utkarsh.gupta550@gmail.com
File Name: pgmpy/inference/base_continuous.py
Class Name: AbstractGaussian
Method Name: get_val


Project Name: pgmpy/pgmpy
Commit Name: 33a33b24185e45478c4758ac14cab8ae5234c44b
Time: 2016-06-17
Author: utkarsh.gupta550@gmail.com
File Name: pgmpy/inference/base_continuous.py
Class Name: GradientLogPDF
Method Name: __init__


Project Name: pgmpy/pgmpy
Commit Name: 33a33b24185e45478c4758ac14cab8ae5234c44b
Time: 2016-06-17
Author: utkarsh.gupta550@gmail.com
File Name: pgmpy/inference/base_continuous.py
Class Name: AbstractGaussian
Method Name: __init__