MultiLabelClassification extends Prediction implements IMultiLabelClassification { @Override public double[] getPrediction() { return (double[]) super.getPrediction(); } MultiLabelClassification(final double[] predicted);  MultiLabelClassification(final double[] predicted, final double threshold);  MultiLabelClassification(final double[] predicted, final double[] threshold); @Override double[] getPrediction(); int[] getThresholdedPrediction(); @Override int[] getPrediction(final double threshold); @Override int[] getPrediction(final double[] threshold); @Override int[] getRelevantLabels(final double threshold); @Override int[] getIrrelevantLabels(final double threshold);  }
@Test public void testGetPrediction() { double[] pred = classification.getPrediction(); assertEquals("Prediction vector and ground truth value vector are not of the same length", GT_VECTOR.length, pred.length); for (int i = 0; i < GT_VECTOR.length; i++) { assertEquals("Prediction vector is not as expected for index " + i + ".", GT_VECTOR[i], pred[i], DOUBLE_DELTA); } }
@Test public void testGetThresholdedLabelRelevanceVector() { int[] pred = classification.getPrediction(THRESHOLD_SINGLE); assertEquals("Prediction vector and ground truth value vector are not of the same length", EXPECTED_THRESHOLDED_SINGLE.length, pred.length); for (int i = 0; i < EXPECTED_THRESHOLDED_SINGLE.length; i++) { assertEquals("Prediction vector is not as expected for index " + i + ".", EXPECTED_THRESHOLDED_SINGLE[i], pred[i], DOUBLE_DELTA); } }
@Test public void testGetLabelWiseThresholdedLabelRelevanceVector() { int[] pred = classification.getPrediction(THRESHOLD_VECTOR); assertEquals("Prediction vector and ground truth value vector are not of the same length", EXPECTED_THRESHOLDED_VECTOR.length, pred.length); for (int i = 0; i < EXPECTED_THRESHOLDED_VECTOR.length; i++) { assertEquals("Prediction vector is not as expected for index " + i + ".", EXPECTED_THRESHOLDED_VECTOR[i], pred[i], DOUBLE_DELTA); } }