diff --git a/test/ml/test_ml.py b/test/ml/test_ml.py index 9a517314..e30ce553 100644 --- a/test/ml/test_ml.py +++ b/test/ml/test_ml.py @@ -64,7 +64,8 @@ def test_pca(self): def test_pca_robustness(self): dataframe = ml.summarize_networks([INPUT_DIR + 'test-data-s1/s1.txt', INPUT_DIR + 'test-data-s2/s2.txt', INPUT_DIR + 'test-data-s3/s3.txt']) - + expected = pd.read_table(EXPECT_DIR + 'expected-pca-coordinates.tsv') + expected = expected.round(5) for _ in range(5): dataframe_shuffled = dataframe.sample(frac=1, axis=1) # permute the columns ml.pca(dataframe_shuffled, OUT_DIR + 'pca-shuffled-columns.png', OUT_DIR + 'pca-shuffled-columns-variance.txt', @@ -72,8 +73,6 @@ def test_pca_robustness(self): coord = pd.read_table(OUT_DIR + 'pca-shuffled-columns-coordinates.tsv') coord = coord.round(5) # round values to 5 digits to account for numeric differences across machines coord.sort_values(by='algorithm', ignore_index=True, inplace=True) - expected = pd.read_table(EXPECT_DIR + 'expected-pca-coordinates.tsv') - expected = expected.round(5) assert coord.equals(expected) @@ -84,8 +83,6 @@ def test_pca_robustness(self): coord = pd.read_table(OUT_DIR + 'pca-shuffled-rows-coordinates.tsv') coord = coord.round(5) # round values to 5 digits to account for numeric differences across machines coord.sort_values(by='algorithm', ignore_index=True, inplace=True) - expected = pd.read_table(EXPECT_DIR + 'expected-pca-coordinates.tsv') - expected = expected.round(5) assert coord.equals(expected)