code: public Metric normalizePredictions(Metric predictions) {
          Map<Long, Double> metricData = predictions.getDatapoints();
          Map<String, Double> minMax = getMinMax(metricData);
          double min = minMax.get("min");
          double max = minMax.get("max");
  
          Metric predictionsNormalized = new Metric(getResultScopeName(), getResultMetricName());
          Map<Long, Double> metricDataNormalized = new HashMap<>();
  
          if (max - min == 0.0) {
              /**
               * If (max - min) == 0.0, all data points in the predictions metric
               * have the same value. So, all data points in the normalized metric
               * will have value 0. This avoids divide by zero operations later on.
               */
              for (Long timestamp : metricData.keySet()) {
                  metricDataNormalized.put(timestamp, 0.0);
              }
          } else {
              double normalizationConstant = 100.0 / (max - min);
  
              for (Entry<Long, Double> entry : metricData.entrySet()) {
                  Long timestamp = entry.getKey();
                  Double value = entry.getValue();
  
                  // Formula: normalizedValue = (rawValue - min) * (100 / (max - min))
                  Double valueNormalized = (value - min) * normalizationConstant;
                  metricDataNormalized.put(timestamp, valueNormalized);
              }
          }
  
          predictionsNormalized.setDatapoints(metricDataNormalized);
          return predictionsNormalized;
      }
docs: Normalize predictions into a range of [0, 100]. Lowest value will map
  to 0, highest value will map to 100, rest will map to values in between.
  Normalization formula: normalizedValue = (rawValue - min) * (100 / (max - min))
  
  @param predictions Metric to normalize
  @return Normalized metric