class RandomSplit extends AbstractFilterSplit {

	public RandomSplit(Dataset dataset, double trainPercentage, Random random) {
		super(dataset);
		if (trainPercentage <= 0 || trainPercentage > 1) {
			throw new IllegalArgumentException("trainPercentage must be in range (0,1]");
		}
		Objects.requireNonNull(random, "random must not be null");
		int numInstances = CollectionHelper.count(dataset.iterator());
		List<Integer> indices = new ArrayList<>();
		for (int i = 0; i < numInstances; i++) {
			indices.add(i);
		}
		Collections.shuffle(indices, random);
		this.indices = Collections.unmodifiableList(indices);
		this.splitIndex = (int) Math.round(trainPercentage * numInstances);
		LOGGER.debug("numInstances = {}", numInstances);
		LOGGER.debug("splitIndex = {}", splitIndex);
	}

	public  RandomSplit(Dataset dataset, double trainPercentage, Random random);
	public  RandomSplit(Dataset dataset, double trainPercentage);

}