Search in sources :

Example 1 with NoPredictionMergeModel

use of com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel 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)

Example 2 with NoPredictionMergeModel

use of com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel in project pinot by linkedin.

the class AbstractModularizedAnomalyFunction method updateMergedAnomalyInfo.

@Override
public void updateMergedAnomalyInfo(MergedAnomalyResultDTO anomalyToUpdated, MetricTimeSeries timeSeries, DateTime windowStart, DateTime windowEnd, List<MergedAnomalyResultDTO> knownAnomalies) throws Exception {
    AnomalyDetectionContext anomalyDetectionContext = null;
    if (!(getMergeModel() instanceof NoPredictionMergeModel)) {
        anomalyDetectionContext = BackwardAnomalyFunctionUtils.buildAnomalyDetectionContext(this, timeSeries, spec.getTopicMetric(), anomalyToUpdated.getDimensions(), spec.getBucketSize(), spec.getBucketUnit(), windowStart, windowEnd);
    }
    updateMergedAnomalyInfo(anomalyDetectionContext, anomalyToUpdated);
}
Also used : AnomalyDetectionContext(com.linkedin.thirdeye.anomalydetection.context.AnomalyDetectionContext) NoPredictionMergeModel(com.linkedin.thirdeye.anomalydetection.model.merge.NoPredictionMergeModel)

Aggregations

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