@Test public void testBasicFunctionality() { Map<Integer, double[]> data = new HashMap<>(); for (int i = 0; i < twoLinearlySeparableClasses.length; i++) data.put(i, twoLinearlySeparableClasses[i]); LogisticRegressionSGDTrainer trainer = new LogisticRegressionSGDTrainer() .withUpdatesStgy(new UpdatesStrategy<>(new SimpleGDUpdateCalculator(0.2), SimpleGDParameterUpdate.SUM_LOCAL, SimpleGDParameterUpdate.AVG)) .withMaxIterations(100000) .withLocIterations(100) .withBatchSize(14) .withSeed(123L); Vectorizer<Integer, double[], Integer, Double> vectorizer = new DoubleArrayVectorizer<Integer>().labeled(Vectorizer.LabelCoordinate.FIRST); DebugCrossValidation<LogisticRegressionModel, Double, Integer, double[]> scoreCalculator = new DebugCrossValidation<>(); int folds = 4; BinaryClassificationMetrics metrics = (BinaryClassificationMetrics) new BinaryClassificationMetrics() .withMetric(BinaryClassificationMetricValues::accuracy); scoreCalculator .withUpstreamMap(data) .withAmountOfParts(1) .withTrainer(trainer) .withMetric(metrics) .withPreprocessor(vectorizer) .withAmountOfFolds(folds) .isRunningOnPipeline(false); double[] scores = scoreCalculator.scoreByFolds(); assertEquals(0.8389830508474576, scores[0], 1e-6); assertEquals(0.9402985074626866, scores[1], 1e-6); assertEquals(0.8809523809523809, scores[2], 1e-6); assertEquals(0.9921259842519685, scores[3], 1e-6); }
@Override public double[] scoreByFolds() { double[] locScores; locScores = isRunningOnPipeline ? scorePipelineOnIgnite() : scoreOnIgnite(); return locScores; }
CrossValidation extends AbstractCrossValidation<M, L, K, V> { @Override public double[] scoreByFolds() { double[] locScores; locScores = isRunningOnPipeline ? scorePipelineOnIgnite() : scoreOnIgnite(); return locScores; } }
CrossValidation extends AbstractCrossValidation<M, L, K, V> { @Override public double[] scoreByFolds() { double[] locScores; locScores = isRunningOnPipeline ? scorePipelineOnIgnite() : scoreOnIgnite(); return locScores; }  }
CrossValidation extends AbstractCrossValidation<M, L, K, V> { @Override public double[] scoreByFolds() { double[] locScores; locScores = isRunningOnPipeline ? scorePipelineOnIgnite() : scoreOnIgnite(); return locScores; }  @Override double[] scoreByFolds(); CrossValidation<M, L, K, V> withIgnite(Ignite ignite); CrossValidation<M, L, K, V> withUpstreamCache(IgniteCache<K, V> upstreamCache); }
CrossValidation extends AbstractCrossValidation<M, L, K, V> { @Override public double[] scoreByFolds() { double[] locScores; locScores = isRunningOnPipeline ? scorePipelineOnIgnite() : scoreOnIgnite(); return locScores; }  @Override double[] scoreByFolds(); CrossValidation<M, L, K, V> withIgnite(Ignite ignite); CrossValidation<M, L, K, V> withUpstreamCache(IgniteCache<K, V> upstreamCache);  }