test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/tree/impurity/gini/GiniImpurityMeasureTest.java
test_class.identifier: GiniImpurityMeasureTest
test_case.body: @Test
      public void testImpurityRightPart() {
          long[] left = new long[]{0, 0, 0};
          long[] right = new long[]{3, 0, 0};
  
          GiniImpurityMeasure impurity = new GiniImpurityMeasure(left, right);
  
          assertEquals(-3, impurity.impurity(), 1e-10);
      }
test_case.class_method_signature: GiniImpurityMeasureTest.testImpurityRightPart()
test_case.full_signature: @Test public void testImpurityRightPart()
test_case.identifier: testImpurityRightPart
test_case.invocations: assertEquals impurity
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testImpurityRightPart()
focal_class.declarator: serialVersionUID = 5338129703395229970L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 5338129703395229970L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: left
focal_class.modifier: private final
focal_class.original_string: private final long[] left;
focal_class.type: long[]
focal_class.var_name: left
focal_class.declarator: right
focal_class.modifier: private final
focal_class.original_string: private final long[] right;
focal_class.type: long[]
focal_class.var_name: right
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/tree/impurity/gini/GiniImpurityMeasure.java
focal_class.identifier: GiniImpurityMeasure
focal_class.interfaces: implements ImpurityMeasure<GiniImpurityMeasure>
focal_class.class_method_signature: GiniImpurityMeasure.GiniImpurityMeasure(long[] left, long[] right)
focal_class.full_signature:   GiniImpurityMeasure(long[] left, long[] right)
focal_class.identifier: GiniImpurityMeasure
focal_class.parameters: (long[] left, long[] right)
focal_class.signature:  GiniImpurityMeasure(long[] left, long[] right)
focal_class.class_method_signature: GiniImpurityMeasure.impurity()
focal_class.full_signature: @Override public double impurity()
focal_class.identifier: impurity
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double impurity()
focal_class.class_method_signature: GiniImpurityMeasure.add(GiniImpurityMeasure b)
focal_class.full_signature: @Override public GiniImpurityMeasure add(GiniImpurityMeasure b)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (GiniImpurityMeasure b)
focal_class.return: GiniImpurityMeasure
focal_class.signature: GiniImpurityMeasure add(GiniImpurityMeasure b)
focal_class.class_method_signature: GiniImpurityMeasure.subtract(GiniImpurityMeasure b)
focal_class.full_signature: @Override public GiniImpurityMeasure subtract(GiniImpurityMeasure b)
focal_class.identifier: subtract
focal_class.modifiers: @Override public
focal_class.parameters: (GiniImpurityMeasure b)
focal_class.return: GiniImpurityMeasure
focal_class.signature: GiniImpurityMeasure subtract(GiniImpurityMeasure b)
focal_class.class_method_signature: GiniImpurityMeasure.getLeft()
focal_class.full_signature: public long[] getLeft()
focal_class.identifier: getLeft
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long[]
focal_class.signature: long[] getLeft()
focal_class.class_method_signature: GiniImpurityMeasure.getRight()
focal_class.full_signature: public long[] getRight()
focal_class.identifier: getRight
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long[]
focal_class.signature: long[] getRight()
focal_method.body: @Override public double impurity() {
          long leftCnt = 0;
          long rightCnt = 0;
  
          double leftImpurity = 0;
          double rightImpurity = 0;
  
          for (long e : left)
              leftCnt += e;
  
          for (long e : right)
              rightCnt += e;
  
          if (leftCnt > 0)
              for (long e : left)
                  leftImpurity += Math.pow(e, 2) / leftCnt;
  
          if (rightCnt > 0)
              for (long e : right)
                  rightImpurity += Math.pow(e, 2) / rightCnt;
  
          return -(leftImpurity + rightImpurity);
      }
focal_method.class_method_signature: GiniImpurityMeasure.impurity()
focal_method.full_signature: @Override public double impurity()
focal_method.identifier: impurity
focal_method.invocations: pow pow
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: double
focal_method.signature: double impurity()