@Test
public void testScoreWithGoodDatasetAndBinaryMetrics() {

    Map<Integer, double[]> data = new HashMap<>();
    for (int i = 0; i < 1000; i++)
        data.put(i, new double[] {i > 500 ? 1.0 : 0.0, i});
    Vectorizer<Integer, double[], Integer, Double> vectorizer = new DoubleArrayVectorizer<Integer>().labeled(Vectorizer.LabelCoordinate.FIRST);
    DecisionTreeClassificationTrainer trainer = new DecisionTreeClassificationTrainer(1, 0);
    DebugCrossValidation<DecisionTreeNode, 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);
    verifyScores(folds, scoreCalculator.scoreByFolds());
}