feat: add CusumDetector, cumulative sum change detection for streams - #7593
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Oleksandr Klymenko <19151554+alxkm@users.noreply.github.com> Signed-off-by: alxkm <19151554+alxkm@users.noreply.github.com>
alxkm
force-pushed
the
feat/cusum-detector
branch
from
September 7, 2026 15:16
3e1eb5f to
715602f
Compare
DenizAltunkapan
approved these changes
Sep 8, 2026
DenizAltunkapan
enabled auto-merge (squash)
September 8, 2026 08:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CUSUM change detection
Adds CUSUM (cumulative sum) change detection. The repository has no change or
drift detection yet.
A threshold on raw samples only catches changes that are large compared with the
noise. CUSUM accumulates evidence instead: each sample is normalised to
z = (x - target) / sigmaand pushed into two one-sided sums.The allowance
kis a toll paid on every step. On target, the toll exceeds theaverage evidence, so both sums stay pinned at zero and the detector stays quiet
however long it runs. Once the mean shifts by more than
kstandard deviations,the matching sum drifts up until it crosses the threshold
h. A half-sigmashift is invisible in a single sample but clear after twenty. O(1) time and
state per sample.
ShiftSignalis included becauseacceptandscanreturn it.CusumDetectorTestcovers 16 cases. The two that matter most: a stream ontarget raises no alarm over 100,000 samples, and in-control Gaussian noise gives
at most 2 false alarms in 2,000 samples — while a half-sigma drift is still
caught within 60 samples.
clang-format -i --style=file path/to/your/file.java