code: public double calculateScoreMultiDataSet(JavaRDD<MultiDataSet> data, boolean average, int minibatchSize) {
          JavaRDD<Tuple2<Integer, Double>> rdd = data.mapPartitions(new ScoreFlatMapFunctionCGMultiDataSet(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();
          }
      }
docs: Calculate the score for all examples in the provided {@code JavaRDD<MultiDataSet>}, either by summing
  or averaging over the entire data set.
  *
  @param data          Data to score
  @param average       Whether to sum the scores, or average them
  @param minibatchSize The number of examples to use in each minibatch when scoring. If more examples are in a partition than
  this, multiple scoring operations will be done (to avoid using too much memory by doing the whole partition
  in one go)