MultiLabelClassificationPredictionBatch implements IMultiLabelClassificationPredictionBatch { @Override public double[][] getPredictionMatrix() { double[][] predictionMatrix = new double[this.batch.size()][]; IntStream.range(0, this.batch.size()).forEach(x -> predictionMatrix[x] = this.batch.get(x).getPrediction()); return predictionMatrix; } MultiLabelClassificationPredictionBatch(final List<? extends IMultiLabelClassification> batch);  MultiLabelClassificationPredictionBatch(final IMultiLabelClassification[] batch); @Override IMultiLabelClassification get(final int index); @Override int getNumPredictions(); @Override List<? extends IMultiLabelClassification> getPredictions(); @Override double[][] getPredictionMatrix(); @Override int[][] getThresholdedPredictionMatrix(final double threshold); @Override int[][] getThresholdedPredictionMatrix(final double[] threshold);  }
@Test public void testGetPrediction() { double[][] pred = classification.getPredictionMatrix(); assertEquals("Prediction vector and ground truth value vector are not of the same length", GT_MATRIX.length, pred.length); for (int i = 0; i < GT_MATRIX.length; i++) { for (int j = 0; j < GT_MATRIX[i].length; j++) { assertEquals("Prediction vector is not as expected for index " + i + ".", GT_MATRIX[i][j], pred[i][j], DOUBLE_DELTA); } } }