b6a4b26ea39c634adfc46b064375f4af30b7e7a3,Orange/distance/__init__.py,SpearmanRAbsolute,__call__,#SpearmanRAbsolute#Any#Any#Any#,150
Before Change
where r is Spearman"s correlation coefficient.
x1 = e1.x if isinstance(e1, data.RowInstance) else e1.X
x2 = e2.x if isinstance(e2, data.RowInstance) else e2.X if e2 is not None else x1
if x1.ndim == 1 or x2.ndim == 1:
axis = 0
slc = len(x1) if x1.ndim > 1 else 1
else:
slc = len(e1) if axis == 1 else len(e1.domain.attributes )
// stats.spearmanr does not work when e1=Table and e2=RowInstance
// so we replace e1 and e2 and then transpose the result
transpose = False
After Change
dist = (1. - np.abs(rho)) / 2.
else:
dist = (1. - rho) / 2.
if isinstance(dist, np.float):
dist = np.array([[dist]])
elif isinstance(dist, np.ndarray):
dist = dist[:slc, slc:]
if transpose:
dist = dist.T
if isinstance(e1, data.Table) or isinstance(e1, data.RowInstance):
dist = DistMatrix(dist, e1, e2)
else:
dist = DistMatrix(dist)
return dist
SpearmanR = SpearmanDistance(absolute=False)
SpearmanRAbsolute = SpearmanDistance(absolute=True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances Project Name: biolab/orange3
Commit Name: b6a4b26ea39c634adfc46b064375f4af30b7e7a3
Time: 2014-12-19
Author: niko.colneric@gmail.com
File Name: Orange/distance/__init__.py
Class Name: SpearmanRAbsolute
Method Name: __call__
Project Name: biolab/orange3
Commit Name: b6a4b26ea39c634adfc46b064375f4af30b7e7a3
Time: 2014-12-19
Author: niko.colneric@gmail.com
File Name: Orange/distance/__init__.py
Class Name: Jaccard
Method Name: __call__
Project Name: biolab/orange3
Commit Name: b6a4b26ea39c634adfc46b064375f4af30b7e7a3
Time: 2014-12-19
Author: niko.colneric@gmail.com
File Name: Orange/distance/__init__.py
Class Name: SpearmanRAbsolute
Method Name: __call__
Project Name: biolab/orange3
Commit Name: b6a4b26ea39c634adfc46b064375f4af30b7e7a3
Time: 2014-12-19
Author: niko.colneric@gmail.com
File Name: Orange/distance/__init__.py
Class Name: PearsonRAbsolute
Method Name: __call__