e9a7706e526d604042f662b15e8963eaecfa6c98,gplearn/genetic.py,,weighted_pearson,#Any#Any#Any#,73
Before Change
Calculate the weighted Pearson correlation coefficient.
x1_demean = x1 - np.average(x1, weights=w)
x2_demean = x2 - np.average(x2, weights=w)
return ((np.sum(w * x1_demean * x2_demean) / np.sum(w)) /
np.sqrt((np.sum(w * x1_demean ** 2) * np.sum(w * x2_demean ** 2)) /
(np.sum(w) ** 2)))
def weighted_spearman(x1, x2, w):
Calculate the weighted Spearman correlation coefficient.
After Change
def weighted_pearson(x1, x2, w):
Calculate the weighted Pearson correlation coefficient.
old_settings = np.seterr(divide="ignore", invalid="ignore")
x1_demean = x1 - np.average(x1, weights=w)
x2_demean = x2 - np.average(x2, weights=w)
corr = ((np.sum(w * x1_demean * x2_demean) / np.sum(w)) /
np.sqrt((np.sum(w * x1_demean ** 2) * np.sum(w * x2_demean ** 2)) /
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: trevorstephens/gplearn
Commit Name: e9a7706e526d604042f662b15e8963eaecfa6c98
Time: 2015-04-18
Author: trev.stephens@gmail.com
File Name: gplearn/genetic.py
Class Name:
Method Name: weighted_pearson
Project Name: scipy/scipy
Commit Name: 7ca1998b050aeb03a127319402a55736457a4d53
Time: 2016-09-15
Author: person142@users.noreply.github.com
File Name: scipy/linalg/tests/test_decomp.py
Class Name: TestOrdQZ
Method Name: qz_decomp
Project Name: scipy/scipy
Commit Name: 89dc88d8575730e0a2234365b4982bdec2b153a1
Time: 2013-12-30
Author: ralf.gommers@googlemail.com
File Name: scipy/stats/_discrete_distns.py
Class Name: dlaplace_gen
Method Name: _cdf