@Override public void tune(DataSequence observedSeries, DataSequence expectedSeries, IntervalSequence anomalySequence) throws Exception { Float thr[] = null; if (simpleThrType.equals("AdaptiveKSigmaSensitivity")) { thr = AutoSensitivity.getAdaptiveKSigmaSensitivity(observedSeries.getValues(), amntAutoSensitivity); } else { thr = AutoSensitivity.getAdaptiveMaxMinSigmaSensitivity(observedSeries.getValues(), amntAutoSensitivity, sDAutoSensitivity); } if (!threshold.containsKey("max")) { threshold.put("max", thr[0]); } if (!threshold.containsKey("min")) { threshold.put("min", thr[1]); } }
@Override public void tune(DataSequence observedSeries, DataSequence expectedSeries, IntervalSequence anomalySequence) throws Exception { HashMap<String, ArrayList<Float>> allErrors = aes.initAnomalyErrors(observedSeries, expectedSeries); for (int i = 0; i < (aes.getIndexToError().keySet()).size(); i++) { // Add a new error metric if the error metric has not been // defined by the user. if (!threshold.containsKey(aes.getIndexToError().get(i))) { Float[] fArray = (allErrors.get(aes.getIndexToError().get(i))).toArray(new Float[(allErrors.get(aes.getIndexToError().get(i))).size()]); threshold.put(aes.getIndexToError().get(i), AutoSensitivity.getKSigmaSensitivity(fArray, sDAutoSensitivity)); } } }
int i = 0; float thresh = data[i] + Math.abs(sd * k); int howMany = howManyLess(data, thresh); while (((float) howMany / (float) data.length) <= amntAutoSens) { min = thresh; i++; thresh = data[i] + Math.abs(sd * k); howMany = howManyLess(data, thresh); howMany = howManyGreater(data, thresh); while (((float) howMany / (float) data.length) <= amntAutoSens) { max = thresh; i--; thresh = data[i] - Math.abs(sd * k); howMany = howManyGreater(data, thresh);
@Override public void tune(DataSequence observedSeries, DataSequence expectedSeries, IntervalSequence anomalySequence) throws Exception { // Compute the time-series of errors. HashMap<String, ArrayList<Float>> allErrors = aes.initAnomalyErrors(observedSeries, expectedSeries); for (int i = 0; i < (aes.getIndexToError().keySet()).size(); i++) { // Add a new error metric if the error metric has not been // defined by the user. if (!threshold.containsKey(aes.getIndexToError().get(i))) { Float[] fArray = (allErrors.get(aes.getIndexToError().get(i))).toArray(new Float[(allErrors.get(aes.getIndexToError().get(i))).size()]); threshold.put(aes.getIndexToError().get(i), AutoSensitivity.getLowDensitySensitivity(fArray, sDAutoSensitivity, amntAutoSensitivity)); } } }
XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1); Float d = AutoSensitivity.getLowDensitySensitivity(fArray, sDAutoSensitivity, amntAutoSensitivity); subplot1.addRangeMarker(new ValueMarker(d)); subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
Float min = null; float thresh = mean + Math.abs(sd * k); int howMany = howManyGreater(data, thresh); howMany = howManyGreater(data, thresh); howMany = howManyLess(data, thresh); howMany = howManyLess(data, thresh);