test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/preprocessing/minmaxscaling/MinMaxScalerPreprocessorTest.java
test_class.identifier: MinMaxScalerPreprocessorTest
test_case.body: @Test
      public void testApplyDivisionByZero() {
          double[][] data = new double[][]{{1.}, {1.}, {1.}, {1.}};
  
          MinMaxScalerPreprocessor<Integer, double[]> preprocessor = new MinMaxScalerPreprocessor<>(
              new double[] {1.},
              new double[] {1.},
              new DoubleArrayVectorizer<>(0)
          );
  
          double[][] standardData = new double[][]{{0.}, {0.}, {0.}, {0.}};
  
          for (int i = 0; i < data.length; i++)
              assertArrayEquals(standardData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-8);
      }
test_case.class_method_signature: MinMaxScalerPreprocessorTest.testApplyDivisionByZero()
test_case.full_signature: @Test public void testApplyDivisionByZero()
test_case.identifier: testApplyDivisionByZero
test_case.invocations: assertArrayEquals asArray features apply
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testApplyDivisionByZero()
focal_class.declarator: serialVersionUID = 6997800576392623469L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 6997800576392623469L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: min
focal_class.modifier: private final
focal_class.original_string: private final double[] min;
focal_class.type: double[]
focal_class.var_name: min
focal_class.declarator: max
focal_class.modifier: private final
focal_class.original_string: private final double[] max;
focal_class.type: double[]
focal_class.var_name: max
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/minmaxscaling/MinMaxScalerPreprocessor.java
focal_class.identifier: MinMaxScalerPreprocessor
focal_class.interfaces: implements Preprocessor<K, V>, DeployableObject
focal_class.class_method_signature: MinMaxScalerPreprocessor.MinMaxScalerPreprocessor(double[] min, double[] max, Preprocessor<K, V> basePreprocessor)
focal_class.full_signature: public  MinMaxScalerPreprocessor(double[] min, double[] max, Preprocessor<K, V> basePreprocessor)
focal_class.identifier: MinMaxScalerPreprocessor
focal_class.modifiers: public
focal_class.parameters: (double[] min, double[] max, Preprocessor<K, V> basePreprocessor)
focal_class.signature:  MinMaxScalerPreprocessor(double[] min, double[] max, Preprocessor<K, V> basePreprocessor)
focal_class.class_method_signature: MinMaxScalerPreprocessor.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: MinMaxScalerPreprocessor.getMin()
focal_class.full_signature: public double[] getMin()
focal_class.identifier: getMin
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] getMin()
focal_class.class_method_signature: MinMaxScalerPreprocessor.getMax()
focal_class.full_signature: public double[] getMax()
focal_class.identifier: getMax
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] getMax()
focal_class.class_method_signature: MinMaxScalerPreprocessor.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);
  
          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;
      }
focal_method.class_method_signature: MinMaxScalerPreprocessor.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 size size size get isNaN set set
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)