private Metric predictAnomalies(Map<Long,String> metricData){
  Metric predictions=new Metric(getResultScopeName(),getResultMetricName());
  Map<Long,String> predictionDatapoints=new HashMap<>();
  for (  Map.Entry<Long,String> entry : metricData.entrySet()) {
    Long timestamp=entry.getKey();
    double value=Double.parseDouble(entry.getValue());
    try {
      double anomalyScore=calculateAnomalyScore(value);
      predictionDatapoints.put(timestamp,String.valueOf(anomalyScore));
    }
 catch (    ArithmeticException e) {
      continue;
    }
  }
  predictions.setDatapoints(predictionDatapoints);
  return predictions;
}

private Metric predictAnomalies ( Map < Long , String > metricData ) { Metric predictions = new Metric ( getResultScopeName ( ) , getResultMetricName ( ) ) ; Map < Long , String > predictionDatapoints = new HashMap < > ( ) ; for ( Map . Entry < Long , String > entry : metricData . entrySet ( ) ) { Long timestamp = entry . getKey ( ) ; double value = Double . parseDouble ( entry . getValue ( ) ) ; try { double anomalyScore = calculateAnomalyScore ( value ) ; predictionDatapoints . put ( timestamp , String . valueOf ( anomalyScore ) ) ; } catch ( ArithmeticException e ) { continue ; } } predictions . setDatapoints ( predictionDatapoints ) ; return predictions ; }
assigns an anomaly score to each data point , indicating how likely it is to be an anomaly relative to other points .
