f88ec970f95c3b1fb1f0d72ccf0069732e4a0510,pyod/models/sod.py,SOD,_sod,#SOD#,143

Before Change


            varActual = np.var(ref, axis=0)  // variance of each attribute
            varInds = [1 if (i < varExpect) else 0 for i in varActual]
            relDim = sum(varInds)
            score_ = np.sqrt(np.dot(varInds, np.square(obs - means))/relDim) if relDim > 0 else 0.
            result.append(score_)
        return np.array(result)

    def __check_params(self):

After Change


        :return: numpy array containing the SOD outlier scores for each observation
        
        ref_inds = self.__snn(X)
        res = np.zeros(shape=(X.shape[0], ))
        for i in range(X.shape[0]):
            obs = X[i]
            ref = X[ref_inds[i, ], ]
            means = np.mean(ref, axis=0)  // mean of each column
            // average squared distance of the reference to the mean
            var_total = sum(sum(np.square(ref - means)))/self.ref_set_
            var_expect = self.alpha_ * var_total / X.shape[1]
            var_actual = np.var(ref, axis=0)  // variance of each attribute
            var_inds = [1 if (i < var_expect) else 0 for i in var_actual]
            rel_dim = sum(var_inds)
            if rel_dim != 0:
                res[i] = np.sqrt(np.dot(var_inds, np.square(obs - means)) / rel_dim)

        return res
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: yzhao062/pyod
Commit Name: f88ec970f95c3b1fb1f0d72ccf0069732e4a0510
Time: 2019-06-12
Author: yalmardeny@tssg,org
File Name: pyod/models/sod.py
Class Name: SOD
Method Name: _sod


Project Name: yzhao062/pyod
Commit Name: f5b2d7fecaea7886cc527ee16c292e1cd4bb736a
Time: 2019-05-29
Author: yalmardeny@tssg,org
File Name: pyod/models/sod.py
Class Name: SOD
Method Name: _sod


Project Name: kundajelab/dragonn
Commit Name: 9c158b87f5fb2dca1ed95884e667ab2fc218e1b7
Time: 2017-05-01
Author: jisraeli@stanford.edu
File Name: dragonn/models.py
Class Name: SequenceDNN
Method Name: deeplift