docs: public double calculateScore(JavaRDD<DataSet> data, boolean average, int minibatchSize) {
          JavaRDD<Tuple2<Integer, Double>> rdd = data.mapPartitions(new ScoreFlatMapFunctionCGDataSet(conf.toJson(),
                          sc.broadcast(network.params(false)), minibatchSize));
  
          //Reduce to a single tuple, with example count + sum of scores
          Tuple2<Integer, Double> countAndSumScores = rdd.reduce(new IntDoubleReduceFunction());
          if (average) {
              return countAndSumScores._2() / countAndSumScores._1();
          } else {
              return countAndSumScores._2();
          }
      }