Skip to content

Commit 316aa8d

Browse files
committed
lowered bound on noisy count noise
1 parent d9a7349 commit 316aa8d

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

syndiffix/tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def noisy_count(self) -> int:
117117
for row in self._matching_rows():
118118
row_counter.add(self.context.pid_data[row])
119119

120-
min_count = anon_context.anonymization_params.low_count_params.low_threshold
120+
# min_count = anon_context.anonymization_params.low_count_params.low_threshold
121+
min_count = 1
121122
self._noisy_count_cache = max(row_counter.noisy_count(anon_context), min_count)
122123

123124
return self._noisy_count_cache

tests/clustering/test_measures.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ def test_measure_all() -> None:
2020
np.array(
2121
[
2222
[1.00, 0.2, 0.15, 0.02, 0.05],
23-
[0.2, 1.00, 0.18, 0.02, 0.05],
23+
[0.2, 1.00, 0.18, 0.02, 0.06],
2424
[0.15, 0.18, 1.00, 0.04, 0.07],
25-
[0.02, 0.02, 0.04, 1.00, 0],
26-
[0.05, 0.05, 0.07, 0, 1.00],
25+
[0.02, 0.02, 0.04, 1.00, 0.01],
26+
[0.05, 0.06, 0.07, 0.01, 1.00],
2727
]
2828
),
2929
)
3030

31-
assert np.array_equal(
32-
np.round(measures.entropy_1dim, 3),
33-
np.array([16.042, 15.886, 5.398, 0.118, 1.350]),
34-
)
31+
assert np.array_equal(np.round(measures.entropy_1dim, 3), np.array([9.214, 9.207, 5.160, 0.118, 1.350]))

0 commit comments

Comments
 (0)