test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/composition/boosting/convergence/mean/MeanAbsValueConvergenceCheckerTest.java
test_class.identifier: MeanAbsValueConvergenceCheckerTest
test_class.superclass: extends ConvergenceCheckerTest
test_case.body: @Test
      public void testConvergenceChecking() {
          LocalDatasetBuilder<Integer, LabeledVector<Double>> datasetBuilder = new LocalDatasetBuilder<>(data, 1);
          ConvergenceChecker<Integer, LabeledVector<Double>> checker = createChecker(
              new MeanAbsValueConvergenceCheckerFactory(0.1), datasetBuilder);
  
          double error = checker.computeError(VectorUtils.of(1, 2), 4.0, notConvergedMdl);
          LearningEnvironmentBuilder envBuilder = TestUtils.testEnvBuilder();
  
          Assert.assertEquals(1.9, error, 0.01);
          Assert.assertFalse(checker.isConverged(envBuilder, datasetBuilder, notConvergedMdl));
          Assert.assertTrue(checker.isConverged(envBuilder, datasetBuilder, convergedMdl));
  
          try (LocalDataset<EmptyContext, FeatureMatrixWithLabelsOnHeapData> dataset = datasetBuilder.build(
              envBuilder,
              new EmptyContextBuilder<>(), new FeatureMatrixWithLabelsOnHeapDataBuilder<>(vectorizer),
              envBuilder.buildForTrainer())) {
  
              double onDSError = checker.computeMeanErrorOnDataset(dataset, notConvergedMdl);
              Assert.assertEquals(1.55, onDSError, 0.01);
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
test_case.class_method_signature: MeanAbsValueConvergenceCheckerTest.testConvergenceChecking()
test_case.full_signature: @Test public void testConvergenceChecking()
test_case.identifier: testConvergenceChecking
test_case.invocations: createChecker computeError of testEnvBuilder assertEquals assertFalse isConverged assertTrue isConverged build buildForTrainer computeMeanErrorOnDataset assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConvergenceChecking()
focal_class.declarator: serialVersionUID = 8534776439755210864L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 8534776439755210864L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/composition/boosting/convergence/mean/MeanAbsValueConvergenceChecker.java
focal_class.identifier: MeanAbsValueConvergenceChecker
focal_class.class_method_signature: MeanAbsValueConvergenceChecker.MeanAbsValueConvergenceChecker(long sampleSize, IgniteFunction<Double, Double> externalLbToInternalMapping,
          Loss loss, DatasetBuilder<K, V> datasetBuilder, Preprocessor<K, V> preprocessor, double precision)
focal_class.full_signature: public  MeanAbsValueConvergenceChecker(long sampleSize, IgniteFunction<Double, Double> externalLbToInternalMapping,
          Loss loss, DatasetBuilder<K, V> datasetBuilder, Preprocessor<K, V> preprocessor, double precision)
focal_class.identifier: MeanAbsValueConvergenceChecker
focal_class.modifiers: public
focal_class.parameters: (long sampleSize, IgniteFunction<Double, Double> externalLbToInternalMapping,
          Loss loss, DatasetBuilder<K, V> datasetBuilder, Preprocessor<K, V> preprocessor, double precision)
focal_class.signature:  MeanAbsValueConvergenceChecker(long sampleSize, IgniteFunction<Double, Double> externalLbToInternalMapping,
          Loss loss, DatasetBuilder<K, V> datasetBuilder, Preprocessor<K, V> preprocessor, double precision)
focal_class.class_method_signature: MeanAbsValueConvergenceChecker.computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_class.full_signature: @Override public Double computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_class.identifier: computeMeanErrorOnDataset
focal_class.modifiers: @Override public
focal_class.parameters: (
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_class.return: Double
focal_class.signature: Double computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_class.class_method_signature: MeanAbsValueConvergenceChecker.computeStatisticOnPartition(ModelsComposition mdl,
          FeatureMatrixWithLabelsOnHeapData part)
focal_class.full_signature: private IgniteBiTuple<Double, Long> computeStatisticOnPartition(ModelsComposition mdl,
          FeatureMatrixWithLabelsOnHeapData part)
focal_class.identifier: computeStatisticOnPartition
focal_class.modifiers: private
focal_class.parameters: (ModelsComposition mdl,
          FeatureMatrixWithLabelsOnHeapData part)
focal_class.return: IgniteBiTuple<Double, Long>
focal_class.signature: IgniteBiTuple<Double, Long> computeStatisticOnPartition(ModelsComposition mdl,
          FeatureMatrixWithLabelsOnHeapData part)
focal_class.class_method_signature: MeanAbsValueConvergenceChecker.reduce(IgniteBiTuple<Double, Long> left, IgniteBiTuple<Double, Long> right)
focal_class.full_signature: private IgniteBiTuple<Double, Long> reduce(IgniteBiTuple<Double, Long> left, IgniteBiTuple<Double, Long> right)
focal_class.identifier: reduce
focal_class.modifiers: private
focal_class.parameters: (IgniteBiTuple<Double, Long> left, IgniteBiTuple<Double, Long> right)
focal_class.return: IgniteBiTuple<Double, Long>
focal_class.signature: IgniteBiTuple<Double, Long> reduce(IgniteBiTuple<Double, Long> left, IgniteBiTuple<Double, Long> right)
focal_class.superclass: extends ConvergenceChecker<K, V>
focal_method.body: @Override public Double computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl) {
  
          IgniteBiTuple<Double, Long> sumAndCnt = dataset.compute(
              partition -> computeStatisticOnPartition(mdl, partition),
              this::reduce
          );
  
          if (sumAndCnt == null || sumAndCnt.getValue() == 0)
              return Double.NaN;
          return sumAndCnt.getKey() / sumAndCnt.getValue();
      }
focal_method.class_method_signature: MeanAbsValueConvergenceChecker.computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_method.full_signature: @Override public Double computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_method.identifier: computeMeanErrorOnDataset
focal_method.invocations: compute computeStatisticOnPartition getValue getKey getValue
focal_method.modifiers: @Override public
focal_method.parameters: (
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)
focal_method.return: Double
focal_method.signature: Double computeMeanErrorOnDataset(
          Dataset<EmptyContext, ? extends FeatureMatrixWithLabelsOnHeapData> dataset,
          ModelsComposition mdl)