class MeanAbsValueConvergenceChecker extends ConvergenceChecker<K, V> {

    @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();
    }

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

}