xiaohui-sun commented on a change in pull request #4176: [TE] anomaly detector
interface change and implementation for rule-based detection
URL: https://github.com/apache/incubator-pinot/pull/4176#discussion_r279849032
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/components/AbsoluteChangeRuleDetector.java
##########
@@ -105,11 +109,44 @@
// make anomalies
DatasetConfigDTO datasetConfig =
data.getDatasetForMetricId().get(me.getId());
- return DetectionUtils.makeAnomalies(slice, df, COL_ANOMALY,
window.getEndMillis(),
+ List<MergedAnomalyResultDTO> anomalies =
DetectionUtils.makeAnomalies(slice, df, COL_ANOMALY, window.getEndMillis(),
DetectionUtils.getMonitoringGranularityPeriod(monitoringGranularity,
datasetConfig), datasetConfig);
+ return DetectionResult.from(anomalies,
TimeSeries.fromDataFrame(constructAbsoluteChangeBoundaries(df)));
}
@Override
+ public TimeSeries computePredictedTimeSeries(MetricSlice slice) {
+ InputData data = this.dataFetcher.fetchData(new
InputDataSpec().withTimeseriesSlices(this.baseline.scatter(slice)));
+ DataFrame dfBase = this.baseline.gather(slice, data.getTimeseries());
+ return TimeSeries.fromDataFrame(constructAbsoluteChangeBoundaries(dfBase));
+ }
+
+ private DataFrame constructAbsoluteChangeBoundaries(DataFrame dfBase) {
+ if (!Double.isNaN(this.absoluteChange)) {
Review comment:
I see. It is a little weird to use NaN as default value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]