class MinMaxScalerPreprocessor implements Preprocessor<K, V>, DeployableObject {

    @Override public LabeledVector apply(K k, V v) {
        LabeledVector res = basePreprocessor.apply(k, v);

        assert res.size() == min.length;
        assert res.size() == max.length;

        for (int i = 0; i < res.size(); i++) {
            double num = res.get(i) - min[i];
            double denom = max[i] - min[i];
            double scaled = num / denom;

            if (Double.isNaN(scaled))
                res.set(i, num);
            else
                res.set(i, scaled);
        }

        return res;
    }

    public  MinMaxScalerPreprocessor(double[] min, double[] max, Preprocessor<K, V> basePreprocessor);

}