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

Bugfix for detecting change points based on MOA #1613

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion river/drift/adwin_c.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ cdef class AdaptiveWindowing:
break
bucket = self.bucket_deque[idx]

for k in range(bucket.current_idx - 1):
for k in range(bucket.current_idx):
n2 = self._calculate_bucket_size(idx) # length of window 2
u2 = bucket.get_total_at(k) # total of window 2
# Warning: means are calculated inside the loop to get updated values.
Expand Down Expand Up @@ -307,6 +307,7 @@ cdef class AdaptiveWindowing:
+ (1.0 / (n1 - self.min_window_length + 1)))
epsilon = (sqrt(2 * m_recip * self.variance_in_window * delta_prime)
+ 2 / 3 * delta_prime * m_recip)

return fabs(delta_mean) > epsilon


Expand Down
2 changes: 1 addition & 1 deletion river/drift/test_drift_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def test_adwin():
expected_indices = [1055]
expected_indices = [1023]
detected_indices = perform_test(drift.ADWIN(), data_stream_1)

assert detected_indices == expected_indices
Expand Down
Loading