Add options to EDDM drift detector so its parameters can be configured - #335
Open
nikolas-sapa wants to merge 1 commit into
Open
nikolas-sapa wants to merge 1 commit into
nikolas-sapa wants to merge 1 commit into
Conversation
EDDM hardcoded its parameters as private constants, making them unreachable from the CLI and from any wrapper reading MOA's option registry - it was the only detector in the package with no options. Mirror DDM by exposing minNumInstances, warningLevel, outcontrolLevel and minNumErrors as javacliparser options. Defaults are unchanged, so detection behaviour is identical.
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.
EDDM is the only drift detector in
moa.classifiers.core.driftdetectionthatexposes no options. The other fourteen expose between one and six each:
Instead, EDDM hardcodes its parameters as
private static finalconstants(
FDDM_MINNUMINSTANCES = 30,FDDM_WARNING = 0.95,FDDM_OUTCONTROL = 0.9)plus a plain field (
m_minNumErrors = 30) that gates both the change andthe warning conditions. That makes them unreachable from the command line and
from any wrapper that reads MOA's option registry.
DDM in the same package already exposes its equivalents, so this patch mirrors
the neighbouring class.
This came up while adding an EDDM wrapper to CapyMOA
(adaptive-machine-learning/CapyMOA#422). Its
MOADriftDetectorconfigures detectors withgetOptions().setViaCLIString(cli), so an EDDM wrapper cannot accept the same-n/-w/-oarguments its DDM wrapper accepts. Today that call fails with:which is why the merged wrapper has no hyper-parameters and
EDDM().get_params()returns an empty dict, while
DDM().get_params()returns three. With theoptions added, the identical call is accepted and the wrapper can mirror DDM
exactly.
What changes
The three constants and the
m_minNumErrorsfield become javacliparseroptions, following
DDM.javafor names, short flags, declaration order, andthe place where the values are read:
minNumInstances-nFDDM_MINNUMINSTANCESwarningLevel-wFDDM_WARNINGoutcontrolLevel-oFDDM_OUTCONTROLminNumErrors-em_minNumErrorsfieldValues are read in
resetLearning(), matching DDM. The comparison sites ininput()now use the instance fields.minNumErrorsis included because it gates both alarm conditions, and it isdirectly useful in practice: while porting EDDM to another toolkit we observed
the default of 30 false-alarming during a learner's convergence phase (early
error-distance outliers inflate the variance baseline), which users currently
cannot fix without recompiling.
Behaviour
Defaults are unchanged, so no existing result moves: with default values the
detector produces identical output before and after the patch (first warning at
61, first change at 105, 8 changes over a 2000-sample reference stream).
Setting the options has the expected monotone effect:
outcontrolLevel(the drift threshold) — 0.4 → 0 changes,0.6 → 0, 0.8 → 1 (at 1092), 0.9 → 8 (first at 105).
minNumInstances(warm-up) — 10 → first at 61 (15 changes),30 → 105 (8), 200 → 337 (3), 600 → 1187 (1).
minNumErrors(error-count gate) — 10 → first at 36,30 → 105, 60 → 118, 120 → 242.
Notes
--release 8setting; introduces nonew compiler warnings.
warningLevel >= outcontrolLevelis added, consistentwith DDM; the constraint is documented in the option descriptions.
Assisted-by: codebuff:deepseek-v4-flash