question: public Metric normalizePredictions ( Metric predictions ) { Map < Long , String > 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 , String > metricDataNormalized = new HashMap < > ( ) ; if ( max - min == 0.0 ) { for ( Long timestamp : metricData . keySet ( ) ) { metricDataNormalized . put ( timestamp , "0.0" ) ; } } else { double normalizationConstant = 100.0 / ( max - min ) ; for ( Entry < Long , String > entry : metricData . entrySet ( ) ) { Long timestamp = entry . getKey ( ) ; Double value = Double . parseDouble ( entry . getValue ( ) ) ; Double valueNormalized = ( value - min ) * normalizationConstant ; metricDataNormalized . put ( timestamp , String . valueOf ( valueNormalized ) ) ; } } predictionsNormalized . setDatapoints ( metricDataNormalized ) ; return predictionsNormalized ; }
target:  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))