org.apache.ignite.ml.composition.boosting.convergence

## Class ConvergenceChecker<K,V>

- java.lang.Object
- - org.apache.ignite.ml.composition.boosting.convergence.ConvergenceChecker<K,V>

- Type Parameters:
    `K` - Type of a key in upstream data.
    `V` - Type of a value in upstream data.
  All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    ConvergenceCheckerStub, MeanAbsValueConvergenceChecker, MedianOfMedianConvergenceChecker

      public abstract class ConvergenceChecker<K,V>
      extends Object
      implements Serializable

  Contains logic of error computing and convergence checking for Gradient Boosting algorithms.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConvergenceChecker(long sampleSize, IgniteFunction<Double,Double> externalLbToInternalMapping, Loss loss, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor, double precision)` Constructs an instance of ConvergenceChecker.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `computeError(Vector features, Double answer, ModelsComposition currMdl)` Compute error for the specific vector of dataset.
    `abstract Double` | `computeMeanErrorOnDataset(Dataset<EmptyContext,? extends FeatureMatrixWithLabelsOnHeapData> dataset, ModelsComposition mdl)` Compute error for given model on learning dataset.
    `boolean` | `isConverged(Dataset<EmptyContext,? extends FeatureMatrixWithLabelsOnHeapData> dataset, ModelsComposition currMdl)` Checks convergency on dataset.
    `boolean` | `isConverged(LearningEnvironmentBuilder envBuilder, DatasetBuilder<K,V> datasetBuilder, ModelsComposition currMdl)` Checks convergency on dataset.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConvergenceChecker

          public ConvergenceChecker(long sampleSize,
                                    IgniteFunction<Double,Double> externalLbToInternalMapping,
                                    Loss loss,
                                    DatasetBuilder<K,V> datasetBuilder,
                                    Preprocessor<K,V> preprocessor,
                                    double precision)

      Constructs an instance of ConvergenceChecker.
      Parameters:
        `sampleSize` - Sample size.
        `externalLbToInternalMapping` - External label to internal mapping.
        `loss` - Loss gradient.
        `datasetBuilder` - Dataset builder.
        `preprocessor` - Upstream preprocessor.
        `precision` - Precision.FeatureMatrixWithLabelsOnHeapDataBuilder.java

  - ### Method Detail

    - #### isConverged

          public boolean isConverged(LearningEnvironmentBuilder envBuilder,
                                     DatasetBuilder<K,V> datasetBuilder,
                                     ModelsComposition currMdl)

      Checks convergency on dataset.
      Parameters:
        `envBuilder` - Learning environment builder.
        `currMdl` - Current model.
      Returns:
        True if GDB is converged.

    - #### isConverged

          public boolean isConverged(Dataset<EmptyContext,? extends FeatureMatrixWithLabelsOnHeapData> dataset,
                                     ModelsComposition currMdl)

      Checks convergency on dataset.
      Parameters:
        `dataset` - Dataset.
        `currMdl` - Current model.
      Returns:
        True if GDB is converged.

    - #### computeMeanErrorOnDataset

          public abstract Double computeMeanErrorOnDataset(Dataset<EmptyContext,? extends FeatureMatrixWithLabelsOnHeapData> dataset,
                                                           ModelsComposition mdl)

      Compute error for given model on learning dataset.
      Parameters:
        `dataset` - Learning dataset.
        `mdl` - Model.
      Returns:
        Error mean value.

    - #### computeError

          public double computeError(Vector features,
                                     Double answer,
                                     ModelsComposition currMdl)

      Compute error for the specific vector of dataset.
      Parameters:
        `currMdl` - Current model.
      Returns:
        Error.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022