test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/selection/scoring/metric/classification/AccuracyTest.java
test_class.identifier: AccuracyTest
test_case.body: @Test
      public void testScore() {
          Metric<Integer> scoreCalculator = new Accuracy<>();
  
          LabelPairCursor<Integer> cursor = new TestLabelPairCursor<>(
              Arrays.asList(1, 1, 1, 1),
              Arrays.asList(1, 1, 0, 1)
          );
  
          double score = scoreCalculator.score(cursor.iterator());
  
          assertEquals(0.75, score, 1e-12);
      }
test_case.class_method_signature: AccuracyTest.testScore()
test_case.full_signature: @Test public void testScore()
test_case.identifier: testScore
test_case.invocations: asList asList score iterator assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testScore()
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/selection/scoring/metric/classification/Accuracy.java
focal_class.identifier: Accuracy
focal_class.interfaces: implements Metric<L>
focal_class.class_method_signature: Accuracy.score(Iterator<LabelPair<L>> iter)
focal_class.full_signature: @Override public double score(Iterator<LabelPair<L>> iter)
focal_class.identifier: score
focal_class.modifiers: @Override public
focal_class.parameters: (Iterator<LabelPair<L>> iter)
focal_class.return: double
focal_class.signature: double score(Iterator<LabelPair<L>> iter)
focal_class.class_method_signature: Accuracy.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<L>> iter) {
          long totalCnt = 0;
          long correctCnt = 0;
  
          while (iter.hasNext()) {
              LabelPair<L> e = iter.next();
  
              L prediction = e.getPrediction();
              L truth = e.getTruth();
  
              if (prediction.equals(truth))
                  correctCnt++;
  
              totalCnt++;
          }
  
          return 1.0 * correctCnt / totalCnt;
      }
focal_method.class_method_signature: Accuracy.score(Iterator<LabelPair<L>> iter)
focal_method.full_signature: @Override public double score(Iterator<LabelPair<L>> iter)
focal_method.identifier: score
focal_method.invocations: hasNext next getPrediction getTruth equals
focal_method.modifiers: @Override public
focal_method.parameters: (Iterator<LabelPair<L>> iter)
focal_method.return: double
focal_method.signature: double score(Iterator<LabelPair<L>> iter)