diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaBoost.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaBoost.java index 98276ff75..0bde95042 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaBoost.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaBoost.java @@ -227,7 +227,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } this.lambdaSc.add(0.0); this.lambdaSw.add(0.0); this.epsilon.add(0.0); diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaC2.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaC2.java index 110370401..7048033a1 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaC2.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineAdaC2.java @@ -256,7 +256,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } this.lambdaTP.add(0.0); this.lambdaTN.add(0.0); this.lambdaFP.add(0.0); diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineCSB2.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineCSB2.java index f7fb8575a..f84805014 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineCSB2.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineCSB2.java @@ -249,7 +249,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } this.lambdaFP.add(0.0); this.lambdaFN.add(0.0); this.lambdaSum.add(0.0); diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineRUSBoost.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineRUSBoost.java index 80bd2e828..f9b93d5ea 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineRUSBoost.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineRUSBoost.java @@ -291,7 +291,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } this.lambdaSc.add(0.0); this.lambdaPos.add(0.0); this.lambdaNeg.add(0.0); diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineSMOTEBagging.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineSMOTEBagging.java index f4191a558..eaaf8b1ef 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineSMOTEBagging.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineSMOTEBagging.java @@ -231,7 +231,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } } } } diff --git a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineUnderOverBagging.java b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineUnderOverBagging.java index aed93282f..9235dfe5c 100644 --- a/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineUnderOverBagging.java +++ b/moa/src/main/java/moa/classifiers/meta/imbalanced/OnlineUnderOverBagging.java @@ -209,7 +209,9 @@ protected void adjustEnsembleSize(int nClasses) { for (int i = this.nEstimators; i < nClasses; i++) { this.ensemble.add(this.baseLearner.copy()); this.nEstimators ++; - this.adwinEnsemble.add(new ADWIN()); + if (this.driftDetection) { + this.adwinEnsemble.add(new ADWIN()); + } } } }