test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/preprocessing/normalization/NormalizationPreprocessorTest.java
test_class.identifier: NormalizationPreprocessorTest
test_case.body: @Test
      public void testApply() {
          double[][] data = new double[][]{
              {1, 2, 1},
              {1, 1, 1},
              {1, 0, 0},
          };
  
          Vectorizer<Integer, double[], Integer, Double> vectorizer = new DoubleArrayVectorizer<>(0, 1, 2);
  
          NormalizationPreprocessor<Integer, double[]> preprocessor = new NormalizationPreprocessor<>(
              1,
              vectorizer
          );
  
          double[][] postProcessedData = new double[][]{
              {0.25, 0.5, 0.25},
              {0.33, 0.33, 0.33},
              {1, 0, 0}
          };
  
         for (int i = 0; i < data.length; i++)
             assertArrayEquals(postProcessedData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-2);
      }
test_case.class_method_signature: NormalizationPreprocessorTest.testApply()
test_case.full_signature: @Test public void testApply()
test_case.identifier: testApply
test_case.invocations: assertArrayEquals asArray features apply
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testApply()
focal_class.declarator: serialVersionUID = 6873438115778921295L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 6873438115778921295L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: p
focal_class.modifier: private
focal_class.original_string: private int p;
focal_class.type: int
focal_class.var_name: p
focal_class.declarator: basePreprocessor
focal_class.modifier: private final
focal_class.original_string: private final Preprocessor<K, V> basePreprocessor;
focal_class.type: Preprocessor<K, V>
focal_class.var_name: basePreprocessor
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/preprocessing/normalization/NormalizationPreprocessor.java
focal_class.identifier: NormalizationPreprocessor
focal_class.interfaces: implements Preprocessor<K, V>, DeployableObject
focal_class.class_method_signature: NormalizationPreprocessor.NormalizationPreprocessor(int p, Preprocessor<K, V> basePreprocessor)
focal_class.full_signature: public  NormalizationPreprocessor(int p, Preprocessor<K, V> basePreprocessor)
focal_class.identifier: NormalizationPreprocessor
focal_class.modifiers: public
focal_class.parameters: (int p, Preprocessor<K, V> basePreprocessor)
focal_class.signature:  NormalizationPreprocessor(int p, Preprocessor<K, V> basePreprocessor)
focal_class.class_method_signature: NormalizationPreprocessor.apply(K k, V v)
focal_class.full_signature: @Override public LabeledVector apply(K k, V v)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (K k, V v)
focal_class.return: LabeledVector
focal_class.signature: LabeledVector apply(K k, V v)
focal_class.class_method_signature: NormalizationPreprocessor.foldMap(Vector vec, IgniteBiFunction<Double,Double,Double> foldFun, IgniteDoubleFunction<Double> mapFun, double zero)
focal_class.full_signature: private double foldMap(Vector vec, IgniteBiFunction<Double,Double,Double> foldFun, IgniteDoubleFunction<Double> mapFun, double zero)
focal_class.identifier: foldMap
focal_class.modifiers: private
focal_class.parameters: (Vector vec, IgniteBiFunction<Double,Double,Double> foldFun, IgniteDoubleFunction<Double> mapFun, double zero)
focal_class.return: double
focal_class.signature: double foldMap(Vector vec, IgniteBiFunction<Double,Double,Double> foldFun, IgniteDoubleFunction<Double> mapFun, double zero)
focal_class.class_method_signature: NormalizationPreprocessor.p()
focal_class.full_signature: public double p()
focal_class.identifier: p
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double p()
focal_class.class_method_signature: NormalizationPreprocessor.getDependencies()
focal_class.full_signature: @Override public List<Object> getDependencies()
focal_class.identifier: getDependencies
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Object>
focal_class.signature: List<Object> getDependencies()
focal_method.body: @Override public LabeledVector apply(K k, V v) {
          LabeledVector res = basePreprocessor.apply(k, v);
  
          double pNorm = Math.pow(foldMap(res.features(), Functions.PLUS, Functions.pow(p), 0d), 1.0 / p);
  
          for (int i = 0; i < res.size(); i++)
              res.set(i, res.get(i) / pNorm);
  
          return res;
      }
focal_method.class_method_signature: NormalizationPreprocessor.apply(K k, V v)
focal_method.full_signature: @Override public LabeledVector apply(K k, V v)
focal_method.identifier: apply
focal_method.invocations: apply pow foldMap features pow size set get
focal_method.modifiers: @Override public
focal_method.parameters: (K k, V v)
focal_method.return: LabeledVector
focal_method.signature: LabeledVector apply(K k, V v)