Skip to content

feat(drift): add EDDM drift detector - #422

Open
nikolas-sapa wants to merge 1 commit into
adaptive-machine-learning:mainfrom
nikolas-sapa:feat/eddm-detector
Open

nikolas-sapa wants to merge 1 commit into
adaptive-machine-learning:mainfrom
nikolas-sapa:feat/eddm-detector

Conversation

@nikolas-sapa

Copy link
Copy Markdown

Adds a CapyMOA wrapper for MOA's EDDM (Early Drift Detection Method).

EDDM complements DDM. DDM tracks the error rate. EDDM tracks the distance
between consecutive errors. The two often disagree: EDDM is more stable
on noisy streams, DDM reacts faster when the error rate jumps.

In a quick 10-seed check (error rate 1% -> 2% -> 4% -> 8% over 2000
points, changes at 500/1000/1500): EDDM detected all changes with zero
false alarms; DDM also detected all changes but raised 21 false alarms,
including two before the first change. Both are valid choices; they fail
differently.

Notes:

  • Thin wrapper over moa.classifiers.core.driftdetection.EDDM.
  • EDDM has no tuning parameters in MOA, so the wrapper defines no CLI
    string and get_params() returns {}.
  • The docstring example is deterministic: 1000 correct predictions
    followed by 1000 errors. EDDM flags drift at index 1030. Random
    streams produced pre-change false alarms, so the example uses a
    structured stream instead.

Testing:

  • uv run invoke fmt
  • doctest for the new module passes
  • uv run pytest -q tests/test_detector.py (15 passed, 1 skipped)
  • uv run pytest -q tests/test_eval_detector.py (11 passed)

Assisted-by: codebuff:deepseek-v4-flash

Adds a CapyMOA wrapper for MOA's EDDM (Early Drift Detection Method). EDDM
complements DDM: DDM monitors the error rate, EDDM monitors the distance
between consecutive errors. The two often disagree: EDDM is more stable on
noisy streams, DDM reacts faster when the error rate jumps.

EDDM has no tuning parameters in MOA, so the wrapper only sets
_moa_detector_type and documents usage with a deterministic example.

Assisted-by: codebuff:deepseek-v4-flash
@tachyonicClock

Copy link
Copy Markdown
Collaborator

That doc test failure appears to be on our end (something probably updated). I will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants