Skip to content

Commit

Permalink
🐛 differences for TSNE for 'arm64' vs 'x86_64'
Browse files Browse the repository at this point in the history
- results depends on chip architecture!!! (not good)
  • Loading branch information
enryH committed Sep 2, 2024
1 parent e26d190 commit b818966
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_exploratory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import platform
import pandas as pd
import acore.exploratory_analysis as ea

Expand Down Expand Up @@ -66,11 +67,19 @@ def test_run_pca(self):

def test_run_tsne(self):
components = 2
# ! MAC ARM64 yields these results (using the similar installation)
expected_result = pd.DataFrame({
'group': ['A', 'A', 'B', 'B'],
'x': [-113.341728, 36.020717, 57.2992514, -134.729141],
'y': [131.169082, -59.616630, 110.601203, -39.086254]
})
# ! Ubuntu x64 yields these results:
if not platform.machine() == 'arm64':
expected_result = pd.DataFrame({
'group': ['A', 'A', 'B', 'B'],
'x': [-48.3592, -82.92282, -13.767805, 20.844055],
'y': [-49.15443, 19.951246, 54.28048, -14.870984]
})
result, _ = ea.run_tsne(self.data, drop_cols=['sample', 'subject'], group='group', components=components, perplexity=3, n_iter=1000, init='pca', dropna=True)
result = result['tsne']
pd.testing.assert_frame_equal(result, expected_result, check_exact=False, check_dtype=False)
Expand Down

0 comments on commit b818966

Please sign in to comment.