class MedianOfMedianConvergenceChecker extends ConvergenceChecker<K, V> {

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

        double[] medians = dataset.compute(
            data -> computeMedian(mdl, data),
            this::reduce
        );

        if (medians == null)
            return Double.POSITIVE_INFINITY;
        return getMedian(medians);
    }

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

}