|
@@ -30,6 +30,7 @@ public class EMAnomalyDetector extends BaseAnomalyDetector {
|
|
clusterer = new EM();
|
|
clusterer = new EM();
|
|
try {
|
|
try {
|
|
clusterer.setNumClusters(NUMBER_OF_CLUSTERS);
|
|
clusterer.setNumClusters(NUMBER_OF_CLUSTERS);
|
|
|
|
+ clusterer.setMinStdDev(0.1);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -45,7 +46,7 @@ public class EMAnomalyDetector extends BaseAnomalyDetector {
|
|
double[] dists = clusterer.distributionForInstance(instance);
|
|
double[] dists = clusterer.distributionForInstance(instance);
|
|
double dev = (1-dists[x])*1000;
|
|
double dev = (1-dists[x])*1000;
|
|
|
|
|
|
- if(dev <= 0.1) {
|
|
+ if(dev <= clusterer.getMinStdDev()) {
|
|
System.out.println("EM dist: " + (dev));
|
|
System.out.println("EM dist: " + (dev));
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -69,6 +70,8 @@ public class EMAnomalyDetector extends BaseAnomalyDetector {
|
|
System.out.println("EM failed");
|
|
System.out.println("EM failed");
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ dataset = new Instances("Directions", atts, 100000);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|