test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/selection/scoring/metric/classification/ROCAUCTest.java
test_class.identifier: ROCAUCTest
test_case.body: @Test
      public void testOneDifferentButBalanced() {
          Metric<Double> scoreCalculator = new ROCAUC();
  
          LabelPairCursor<Double> cursor = new TestLabelPairCursor<>(
              Arrays.asList(1.0, 1.0, 0.0, 0.0),
              Arrays.asList(1.0, 1.0, 0.0, 1.0)
          );
  
          double score = scoreCalculator.score(cursor.iterator());
  
          assertEquals(0.75, score, 1e-12);
      }
test_case.class_method_signature: ROCAUCTest.testOneDifferentButBalanced()
test_case.full_signature: @Test public void testOneDifferentButBalanced()
test_case.identifier: testOneDifferentButBalanced
test_case.invocations: asList asList score iterator assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOneDifferentButBalanced()
focal_class.declarator: positiveClsLb = 1.0
focal_class.modifier: private
focal_class.original_string: private double positiveClsLb = 1.0;
focal_class.type: double
focal_class.var_name: positiveClsLb
focal_class.declarator: negativeClsLb
focal_class.modifier: private
focal_class.original_string: private double negativeClsLb;
focal_class.type: double
focal_class.var_name: negativeClsLb
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/selection/scoring/metric/classification/ROCAUC.java
focal_class.identifier: ROCAUC
focal_class.interfaces: implements Metric<Double>
focal_class.class_method_signature: ROCAUC.score(Iterator<LabelPair<Double>> iter)
focal_class.full_signature: @Override public double score(Iterator<LabelPair<Double>> iter)
focal_class.identifier: score
focal_class.modifiers: @Override public
focal_class.parameters: (Iterator<LabelPair<Double>> iter)
focal_class.return: double
focal_class.signature: double score(Iterator<LabelPair<Double>> iter)
focal_class.class_method_signature: ROCAUC.calculateROCAUC(PriorityQueue<Pair<Double, Double>> queue, long pos, long neg, double positiveClsLb)
focal_class.full_signature: public static double calculateROCAUC(PriorityQueue<Pair<Double, Double>> queue, long pos, long neg, double positiveClsLb)
focal_class.identifier: calculateROCAUC
focal_class.modifiers: public static
focal_class.parameters: (PriorityQueue<Pair<Double, Double>> queue, long pos, long neg, double positiveClsLb)
focal_class.return: double
focal_class.signature: double calculateROCAUC(PriorityQueue<Pair<Double, Double>> queue, long pos, long neg, double positiveClsLb)
focal_class.class_method_signature: ROCAUC.positiveClsLb()
focal_class.full_signature: public double positiveClsLb()
focal_class.identifier: positiveClsLb
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double positiveClsLb()
focal_class.class_method_signature: ROCAUC.withPositiveClsLb(double positiveClsLb)
focal_class.full_signature: public ROCAUC withPositiveClsLb(double positiveClsLb)
focal_class.identifier: withPositiveClsLb
focal_class.modifiers: public
focal_class.parameters: (double positiveClsLb)
focal_class.return: ROCAUC
focal_class.signature: ROCAUC withPositiveClsLb(double positiveClsLb)
focal_class.class_method_signature: ROCAUC.negativeClsLb()
focal_class.full_signature: public double negativeClsLb()
focal_class.identifier: negativeClsLb
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double negativeClsLb()
focal_class.class_method_signature: ROCAUC.withNegativeClsLb(double negativeClsLb)
focal_class.full_signature: public ROCAUC withNegativeClsLb(double negativeClsLb)
focal_class.identifier: withNegativeClsLb
focal_class.modifiers: public
focal_class.parameters: (double negativeClsLb)
focal_class.return: ROCAUC
focal_class.signature: ROCAUC withNegativeClsLb(double negativeClsLb)
focal_class.class_method_signature: ROCAUC.name()
focal_class.full_signature: @Override public String name()
focal_class.identifier: name
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String name()
focal_method.body: @Override public double score(Iterator<LabelPair<Double>> iter) {
          //TODO: It should work with not binary values only, see IGNITE-11680.
  
          PriorityQueue<Pair<Double, Double>> queue = new PriorityQueue<>(Comparator.comparingDouble(Pair::getKey));
  
          long pos = 0;
          long neg = 0;
  
          while (iter.hasNext()) {
              LabelPair<Double> e = iter.next();
  
              Double prediction = e.getPrediction();
              Double truth = e.getTruth();
  
              queue.add(new Pair<>(prediction, truth));
  
              if (truth == positiveClsLb)
                  pos++;
              else if (truth == negativeClsLb)
                  neg++;
              else
                  throw new UnknownClassLabelException(truth, positiveClsLb, negativeClsLb);
  
          }
  
          return calculateROCAUC(queue, pos, neg, positiveClsLb);
      }
focal_method.class_method_signature: ROCAUC.score(Iterator<LabelPair<Double>> iter)
focal_method.full_signature: @Override public double score(Iterator<LabelPair<Double>> iter)
focal_method.identifier: score
focal_method.invocations: comparingDouble hasNext next getPrediction getTruth add calculateROCAUC
focal_method.modifiers: @Override public
focal_method.parameters: (Iterator<LabelPair<Double>> iter)
focal_method.return: double
focal_method.signature: double score(Iterator<LabelPair<Double>> iter)