-
-
Notifications
You must be signed in to change notification settings - Fork 605
Binary Drift Detector: McDiarmid Drift Detection Method #1703
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
base: main
Are you sure you want to change the base?
Conversation
- hence no need to explicit pop left
- instead of handling this internally, needs to be mentioned in doc
| if self.drift_detected: | ||
| self._reset() | ||
|
|
||
| self._sliding_window.append(0 if x == 1 else 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused about the input values for correct prediction and incorrect prediction as mentioned in #1532. Can someone please help me out with this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aditya0by0. Multiple classic drift detectors seem to use a binary loss scheme, but there might be other patterns nowadays. I am not aware of the specifics of the algorithms you are contributing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I will check further on it. Btw the following is the corresponding moa code for the algorithm from the author : https://github.com/alipsgh/codes-for-moa/blob/master/drift_detection/MDDM_A.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aditya0by0,
Are there any news on this PR?
Would love to see it in river!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kulbachcedric, I have implemented the algorithm. But I am unable to figure out the right test cases for it.
Because for the existing test data streams of river, the algorithm detects drifts at almost all the timepoints.
river/river/drift/test_drift_detectors.py
Lines 11 to 27 in 05316d4
| np.random.seed(12345) | |
| data_stream_2 = np.concatenate( | |
| [ | |
| [np.random.binomial(1, 0.2) for _ in range(1000)], | |
| [np.random.binomial(1, 0.8) for _ in range(1000)], | |
| ] | |
| ).astype(int) | |
| np.random.seed(12345) | |
| data_stream_3 = np.concatenate( | |
| ( | |
| np.random.normal(0.0, 0.1, 500) > 0, | |
| np.random.normal(0.25, 0.1, 500) > 0, | |
| np.random.normal(0.0, 0.1, 500) > 0, | |
| np.random.normal(0.25, 0.1, 500) > 0, | |
| ) | |
| ).astype(int) |
For the same stream of data I verified it with the author's corresponding python implementations and didn't get any better results. (which might be an indicator that this detector might be worse than the drift detectors which are already provided by river)
- https://github.com/alipsgh/tornado/blob/master/drift_detection/mddm_a.py
- https://github.com/alipsgh/tornado/blob/master/drift_detection/mddm_e.py
- https://github.com/alipsgh/tornado/blob/master/drift_detection/mddm_g.py
For these reasons, I am sure whether to pursue it any further.
PR for Discussion : #1672
Add McDiarmid Drift Detection Methods (MDDM)
Summary
Implements three new binary drift detectors based on McDiarmid's inequality:
MDDM_A– Arithmetic weighting (linear).MDDM_E– Exponential weighting.MDDM_G– Geometric weighting.