Skip to content

Commit

Permalink
Removing entries within shared density and associated timestamp when …
Browse files Browse the repository at this point in the history
…removing a micro-cluster (related to an inquiry from #1468)
  • Loading branch information
hoanganhngo610 committed Dec 8, 2023
1 parent e4ebcd0 commit c4a8676
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions river/cluster/dbstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ def _cleanup(self):

if micro_cluster_i.weight * value < weight_weak:
micro_clusters.pop(i)
self.s.pop(i, None)
self.s_t.pop(i, None)
# Since self.s and self.s_t always have the same keys and are arranged in ascending orders
for j in self.s:
if j < i:
self.s[j].pop(i, None)
self.s_t[j].pop(i, None)
else:
break

# Update microclusters
self._micro_clusters = micro_clusters
Expand Down

0 comments on commit c4a8676

Please sign in to comment.