fun execute(timeSeries: MetricTimeSeries, functionValueMap: FunctionValueMap) { if (timeSeries.isEmpty()) { functionValueMap.add(this, false, null) return } val points: DoubleList = timeSeries.getValues() val q1: Double = Percentile.evaluate(points, .25) val q3: Double = Percentile.evaluate(points, .75) val threshold = (q3 - q1) * 1.5 + q3 for (i in 0 until points.size()) { val point: Double = points.get(i) if (point > threshold) { functionValueMap.add(this, true, null) return } } functionValueMap.add(this, false, null) }
Detects outliers using the default box plot implementation . An outlier every value that is above ( q3-q1 ) *1.5*q3 where qN is the nth percentile