Search in sources :

Example 1 with MergeModel

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);
}
Also used : MergeModel(com.linkedin.thirdeye.anomalydetection.model.merge.MergeModel) NoPredictionMergeModel(com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel) NoPredictionMergeModel(com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel)

Aggregations

MergeModel (com.linkedin.thirdeye.anomalydetection.model.merge.MergeModel)1 NoPredictionMergeModel (com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel)1