Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBSTREAM: fix density graph timestamps #1338

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ River's mini-batch methods now support pandas v2. In particular, River conforms
- Addition of the `-` sign before the `fading_factor` in accordance with the algorithm 2 proposed by Hashler and Bolanos (2016) to allow clusters with low weights to be removed.
- The new `micro_cluster` is added with the key derived from the maximum key of the existing micro clusters. If the set of micro clusters is still empty (`len = 0`), a new micro cluster is added with key 0.
- `cluster_is_up_to_date` is set to `True` at the end of the `self._recluster()` function.
- shared density graph update timestamps are initialized with the current timestamp value

## datasets

Expand Down
4 changes: 2 additions & 2 deletions river/cluster/dbstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ def _update(self, x):
except KeyError:
try:
self.s[i][j] = 0
self.s_t[i][j] = 0
self.s_t[i][j] = self._time_stamp
except KeyError:
self.s[i] = {j: 0}
self.s_t[i] = {j: 0}
self.s_t[i] = {j: self._time_stamp}

# prevent collapsing clusters
for i in neighbor_clusters.keys():
Expand Down
Loading