b5264000f20db429a3bd371ec66178c9fb49e5ce,Orange/distance/distance.py,SpearmanModel,compute_correlation,#SpearmanModel#Any#Any#,434

Before Change


class SpearmanModel(CorrelationDistanceModel):
    def compute_correlation(self, x1, x2):
        rho = stats.spearmanr(x1, x2, axis=self.axis)[0]
        if isinstance(rho, np.float):
            return np.array([[rho]])
        slc = x1.shape[1 - self.axis]
        return rho[:slc, slc:]

After Change


                rho = rho[:2, :2].copy()
            else:
                // scalar if n1 == 1
                rho = stats.spearmanr(x1, axis=self.axis)[0]
            return np.atleast_2d(rho)
        else:
            // this computes too much (most of it is thrown away)
            rho = stats.spearmanr(x1, x2, axis=self.axis)[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: biolab/orange3
Commit Name: b5264000f20db429a3bd371ec66178c9fb49e5ce
Time: 2018-01-16
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/distance/distance.py
Class Name: SpearmanModel
Method Name: compute_correlation


Project Name: nilearn/nilearn
Commit Name: 048aaf4c61a100633af2fcea309f06271d1ed5ef
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: nilearn/sparse_models/_cv_tricks.py
Class Name: EarlyStoppingCallback
Method Name: __call__


Project Name: nilearn/nilearn
Commit Name: 9e558f7f0ecdce57e044c4e80db65b6e2a597d50
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: nilearn/sparse_models/_cv_tricks.py
Class Name: EarlyStoppingCallback
Method Name: __call__