Skip to content
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

EWAppxPercentileOutlierClassifier: update percentile and decay reservoir outside of warmup period #217

Open
ynimous opened this issue Oct 5, 2017 · 0 comments

Comments

@ynimous
Copy link

ynimous commented Oct 5, 2017

I might be missing something, but as the title suggests, the (completely untested) change below updates the threshold after the warm-up period.

diff --git a/legacy/src/main/java/macrobase/analysis/classify/EWAppxPercentileOutlierClassifier.java b/legacy/src/main/java/macrobase/analysis/classify/EWAppxPercentileOutlierClassifier.java
index 05df505..7e49005 100644
--- a/legacy/src/main/java/macrobase/analysis/classify/EWAppxPercentileOutlierClassifier.java
+++ b/legacy/src/main/java/macrobase/analysis/classify/EWAppxPercentileOutlierClassifier.java
@@ -92,8 +92,6 @@ public class EWAppxPercentileOutlierClassifier extends OutlierClassifier {
                 warmupInput.add(d);
                 DatumWithNorm dwn = new DatumWithNorm(d, d.metrics().getNorm());
                 reservoir.insert(dwn);
-                reservoirDecayer.runIfNecessary();
-                percentileUpdater.runIfNecessary();
             } else {
                 if(tupleCount == warmupCount) {
                     updateThreshold(percentile);
@@ -104,6 +102,8 @@ public class EWAppxPercentileOutlierClassifier extends OutlierClassifier {
                     warmupInput.clear();
                 }
 
+                reservoirDecayer.runIfNecessary();
+                percentileUpdater.runIfNecessary();
                 double norm = d.metrics().getNorm();
                 reservoir.insert(new DatumWithNorm(d, norm));
                 batchResult.add(new OutlierClassificationResult(d, norm > currentThreshold));
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

No branches or pull requests

1 participant