diff options
author | Arun Isaac | 2021-11-11 16:10:35 +0530 |
---|---|---|
committer | BonfaceKilz | 2021-11-11 20:49:30 +0300 |
commit | ec1d2180d99e0cde1dc181ee9ed79e86cf1a5675 (patch) | |
tree | 61162273cc9b0b75577573b8b2082a1660cb39c1 /tests/__init__.py | |
parent | 4e790f08000825931cb5edec1738d2b7d073f73e (diff) | |
download | genenetwork3-ec1d2180d99e0cde1dc181ee9ed79e86cf1a5675.tar.gz |
Reimplement correlations2.compute_correlation using pearsonr.
correlations2.compute_correlation computes the Pearson correlation
coefficient. Outsource this computation to scipy.stats.pearsonr. When the
inputs are constant, the Pearson correlation coefficient does not exist and is
represented by NaN. Update the tests to reflect this.
* gn3/computations/correlations2.py: Remove import of sqrt from math.
(compute_correlation): Reimplement using scipy.stats.pearsonr.
* tests/unit/computations/test_correlation.py: Import math.
(TestCorrelation.test_compute_correlation): When inputs are constant, set
expected correlation coefficient to NaN.
Diffstat (limited to 'tests/__init__.py')
0 files changed, 0 insertions, 0 deletions