use of com.linkedin.thirdeye.anomalydetection.model.merge.MergeModel in project pinot by linkedin.
the class AbstractModularizedAnomalyFunction method updateMergedAnomalyInfo.
@Override
public void updateMergedAnomalyInfo(AnomalyDetectionContext anomalyDetectionContext, MergedAnomalyResultDTO anomalyToUpdated) throws Exception {
MergeModel mergeModel = getMergeModel();
if (!(mergeModel instanceof NoPredictionMergeModel)) {
if (checkPrecondition(anomalyDetectionContext)) {
String mainMetric = anomalyDetectionContext.getAnomalyDetectionFunction().getSpec().getTopicMetric();
// Transform current and baseline time series and train the prediction model
transformAndPredictTimeSeries(mainMetric, anomalyDetectionContext);
} else {
LOGGER.error("The precondition of anomaly detection context does not hold: please make sure" + "the observed time series and anomaly function are not null.");
return;
}
}
mergeModel.update(anomalyDetectionContext, anomalyToUpdated);
}
Aggregations