Skip to content

Commit

Permalink
expand ADWIN docs (#1334)
Browse files Browse the repository at this point in the history
  • Loading branch information
smastelini authored Oct 4, 2023
1 parent 1a32e0d commit 7a5709d
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions river/drift/adwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class ADWIN(DriftDetector):
r"""Adaptive Windowing method for concept drift detection.
r"""Adaptive Windowing method for concept drift detection[^1].
ADWIN (ADaptive WINdowing) is a popular drift detection method with mathematical guarantees.
ADWIN efficiently keeps a variable-length window of recent items; such that it holds that
Expand All @@ -22,18 +22,21 @@ class ADWIN(DriftDetector):
delta
Significance value.
clock
How often ADWIN should check for change. 1 means every new data point, default is 32.
How often ADWIN should check for changes. 1 means every new data point, default is 32.
Higher values speed up processing, but may also lead to increased delay in change
detection.
max_buckets
The maximum number of buckets of each size that ADWIN should keep before merging buckets
(default is 5).
The maximum number of buckets of each size that ADWIN should keep before merging buckets.
The idea of data buckets comes from the compression algorithm introduced in the ADWIN2,
the second iteration of the ADWIN algorithm presented in the original research paper.
This is the ADWIN version available in River.
min_window_length
The minimum length of each subwindow (default is 5). Lower values may decrease delay in
change detection but may also lead to more false positives.
The minimum length allowed for a subwindow when checking for concept drift. Subwindows whose size
is smaller than this value will be ignored during concept drift evaluation. Lower values may
decrease delay in change detection but may also lead to more false positives.
grace_period
ADWIN does not perform any change detection until at least this many data points have
arrived (default is 10).
arrived.
Examples
--------
Expand Down Expand Up @@ -82,20 +85,23 @@ def _reset(self):
)

@property
def width(self):
def width(self) -> int:
"""Window size"""
return self._helper.get_width()

@property
def n_detections(self):
def n_detections(self) -> int:
"""The total number of detected changes."""
return self._helper.get_n_detections()

@property
def variance(self):
def variance(self) -> float:
"""The sample variance within the stored (adaptive) window."""
return self._helper.get_variance()

@property
def total(self):
def total(self) -> float:
"""The sum of the stored elements."""
return self._helper.get_total()

@property
Expand Down

0 comments on commit 7a5709d

Please sign in to comment.