presto-ml/src/main/java/io/prestosql/plugin/ml/FeatureVectorUnitNormalizer.java/FeatureVectorUnitNormalizer/transform
class FeatureVectorUnitNormalizer:    @Override
    public FeatureVector transform(FeatureVector features)
    {
        double sumSquares = 0;
        for (Double value : features.getFeatures().values()) {
            sumSquares += value * value;
        }
        double magnitude = Math.sqrt(sumSquares);
        Map<Integer, Double> transformed = new HashMap<>();
        for (Map.Entry<Integer, Double> entry : features.getFeatures().entrySet()) {
            transformed.put(entry.getKey(), entry.getValue() / magnitude);
        }
        return new FeatureVector(transformed);
    }