GroupedLeaveOneOut implements
		CrossValidator<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> { @Override public CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> createIterable( GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data) { return new GroupedLeaveOneOutIterable(data); }  @Override CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> createIterable(
			GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data); @Override String toString();  }
@Test public void testEqual() { final GroupedLeaveOneOut<String, Integer> cv = new GroupedLeaveOneOut<String, Integer>(); final CrossValidationIterable<GroupedDataset<String, ListDataset<Integer>, Integer>> iterable = cv .createIterable(equalDataset); for (final ValidationData<GroupedDataset<String, ListDataset<Integer>, Integer>> cvData : iterable) { final GroupedDataset<String, ListDataset<Integer>, Integer> training = cvData.getTrainingDataset(); final GroupedDataset<String, ListDataset<Integer>, Integer> validation = cvData.getValidationDataset(); assertEquals(1, validation.numInstances()); assertEquals(equalDataset.numInstances() - 1, training.numInstances()); assertEquals(equalDataset.numInstances(), validation.numInstances() + training.numInstances()); } }
@Test public void testUnequal() { final GroupedLeaveOneOut<String, Integer> cv = new GroupedLeaveOneOut<String, Integer>(); final CrossValidationIterable<GroupedDataset<String, ListDataset<Integer>, Integer>> iterable = cv .createIterable(unequalDataset); for (final ValidationData<GroupedDataset<String, ListDataset<Integer>, Integer>> cvData : iterable) { final GroupedDataset<String, ListDataset<Integer>, Integer> training = cvData.getTrainingDataset(); final GroupedDataset<String, ListDataset<Integer>, Integer> validation = cvData.getValidationDataset(); assertEquals(1, validation.numInstances()); assertEquals(unequalDataset.numInstances() - 1, training.numInstances()); assertEquals(unequalDataset.numInstances(), validation.numInstances() + training.numInstances()); } }