Skip to content

Commit

Permalink
Merge 1dc4842 into efc2a2a
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Oct 12, 2020
2 parents efc2a2a + 1dc4842 commit 891911d
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/cr/cube/measures/pairwise_significance.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def t_stats_scale_means(self):
)

tstats_scale_means = (
self._slice.scale_means_row[self._col_idx] - self._slice.scale_means_row
self._slice.scale_means_row - self._slice.scale_means_row[self._col_idx]
) / (standard_deviation * np.sqrt((1 / counts[self._col_idx]) + (1 / counts)))

return tstats_scale_means
Expand Down
14 changes: 7 additions & 7 deletions tests/expectations/cat-x-cat-hs-scale-mean-pw-idxs-alt.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(
(3, 4, 5, 8, 10),
(3, 4, 5, 8, 10),
(3, 4, 5, 8, 10),
(),
(),
(10,),
(3, 4, 5, 8, 10),
(3, 4, 10),
(),
(4, 10),
(0, 1, 2, 6, 7),
(0, 1, 2, 6, 7, 9),
(0, 1, 2, 6),
(),
(),
(0, 1, 2, 6),
(),
(0, 1, 2, 5, 6, 7, 9),
)
12 changes: 6 additions & 6 deletions tests/expectations/cat-x-cat-hs-scale-mean-pw-idxs.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(
(3, 4, 5, 8, 10),
(3, 4, 10),
(3, 4, 5, 8, 10),
(),
(),
(),
(3, 4, 5, 8, 10),
(3, 4, 10),
(0, 1, 2, 6, 7),
(0, 1, 2, 6, 7),
(0, 2, 6),
(),
(10,),
(),
(0, 2, 6),
(),
(0, 1, 2, 6, 7, 9),
)
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-cat-scale-mean-pw-idxs-alt.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0,), (0,))
((1, 2), (), ())
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-cat-scale-mean-pw-idxs.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0,), (0,))
((1, 2), (), ())
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-mr-aug-scale-mean-pw-idxs-alt.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0, 4), (0,), (0, 4), ())
((1, 2, 3), (), (), (), (1, 3))
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-mr-aug-scale-mean-pw-idxs.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0,), (), (0, 4), ())
((1, 3), (), (), (), (3,))
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-mr-scale-mean-pw-idxs-alt.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0,), (0, 1), (0, 1, 4), (0,))
((1, 2, 3, 4), (2, 3), (), (), (3,))
2 changes: 1 addition & 1 deletion tests/expectations/cat-x-mr-scale-mean-pw-idxs.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
((), (0,), (0, 1), (0, 1, 4), (0,))
((1, 2, 3, 4), (2, 3), (), (), (3,))
34 changes: 17 additions & 17 deletions tests/integration/test_pairwise_significance.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_pairwise_measures_scale_means_nps_type(self):
assert actual.p_vals_scale_means[0] == 1
assert actual.t_stats_scale_means[0] == 0
np.testing.assert_almost_equal(
actual.t_stats_scale_means, [0.0, -1.08966143, 1.27412884, 4.14629088]
actual.t_stats_scale_means, [0.0, 1.08966143, -1.27412884, -4.14629088]
)
np.testing.assert_almost_equal(
actual.p_vals_scale_means,
Expand All @@ -164,7 +164,7 @@ def test_pairwise_measures_scale_means_nps_type(self):
[2.7638510e-01, 1.0000000e00, 1.4344585e-03, 1.7905266e-09],
)
np.testing.assert_almost_equal(
actual.t_stats_scale_means, [1.08966143, 0.0, 3.19741668, 6.10466696]
actual.t_stats_scale_means, [-1.08966143, 0.0, -3.19741668, -6.10466696]
)

def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):
Expand All @@ -177,7 +177,7 @@ def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):

np.testing.assert_almost_equal(
actual.t_stats_scale_means,
[0.0, -1.64461503, -1.92387847, np.nan, -1.06912069],
[0.0, 1.64461503, 1.92387847, np.nan, 1.06912069],
)
np.testing.assert_almost_equal(
actual.p_vals_scale_means, [1.0, 0.1046981, 0.059721, np.nan, 0.2918845]
Expand All @@ -189,7 +189,7 @@ def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):

np.testing.assert_almost_equal(
actual.t_stats_scale_means,
[0.0, -0.9387958, -1.644615, -1.9238785, np.nan, -1.0691207],
[0.0, 0.9387958, 1.644615, 1.9238785, np.nan, 1.0691207],
)

np.testing.assert_almost_equal(
Expand All @@ -207,7 +207,7 @@ def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):

np.testing.assert_almost_equal(
actual.t_stats_scale_means,
[0.0, -0.93879579, -1.64461503, -1.92387847, -1.06912069],
[0.0, 0.93879579, 1.64461503, 1.92387847, 1.06912069],
)
np.testing.assert_almost_equal(
actual.p_vals_scale_means, [1.0, 0.3500141, 0.1046981, 0.059721, 0.2918845]
Expand All @@ -222,7 +222,7 @@ def test_ttests_scale_means_cat_x_cat_pruning_and_hs(self):
actual = slice_.pairwise_significance_tests[0]

np.testing.assert_almost_equal(
actual.t_stats_scale_means, [0.0, -1.64461503, -1.92387847, -1.06912069]
actual.t_stats_scale_means, [0.0, 1.64461503, 1.92387847, 1.06912069]
)
np.testing.assert_almost_equal(
actual.p_vals_scale_means, [1.0, 0.1046981, 0.059721, 0.2918845]
Expand All @@ -236,16 +236,16 @@ def test_pairwise_t_stats_scale_means_with_hs(self):
actual.t_stats_scale_means,
[
0.0,
0.70543134,
0.06749456,
3.59627589,
4.15672996,
3.26353764,
0.30034779,
0.8383222,
3.02379687,
0.85672124,
4.26974185,
-0.70543134,
-0.06749456,
-3.59627589,
-4.15672996,
-3.26353764,
-0.30034779,
-0.8383222,
-3.02379687,
-0.85672124,
-4.26974185,
],
)

Expand All @@ -271,7 +271,7 @@ def test_ttests_scale_means_use_unweighted_n_for_variance(self):
actual = slice_.pairwise_significance_tests[0]

np.testing.assert_almost_equal(
actual.t_stats_scale_means, [0.0, 4.38871748, 3.99008596, 5.15679647]
actual.t_stats_scale_means, [0.0, -4.38871748, -3.99008596, -5.15679647]
)
np.testing.assert_almost_equal(
actual.p_vals_scale_means,
Expand Down

0 comments on commit 891911d

Please sign in to comment.