DataType
- The type of data to create folds over.public class RandomByTwoFoldCreator<DataType> extends AbstractRandomized implements ValidationFoldCreator<DataType,DataType>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUM_SPLITS
The default number of splits is 5.
|
protected int |
numSplits
The number of splits.
|
random
Constructor and Description |
---|
RandomByTwoFoldCreator()
Creates a new
RandomByTwoFoldCreator with a default number of
splits. |
RandomByTwoFoldCreator(int numSplits)
Creates a new
RandomByTwoFoldCreator with a given number of
splits. |
RandomByTwoFoldCreator(int numSplits,
java.util.Random random)
Creates a new
RandomByTwoFoldCreator with a given number of
splits. |
Modifier and Type | Method and Description |
---|---|
java.util.List<PartitionedDataset<DataType>> |
createFolds(java.util.Collection<? extends DataType> data)
Creates a list of partitioned (training and testing) datasets from the
given single dataset.
|
int |
getNumSplits()
Gets the number of splits to perform.
|
void |
setNumSplits(int numSplits)
Sets the number of splits to perform.
|
clone, getRandom, setRandom
public static final int DEFAULT_NUM_SPLITS
protected int numSplits
public RandomByTwoFoldCreator()
RandomByTwoFoldCreator
with a default number of
splits.public RandomByTwoFoldCreator(int numSplits)
RandomByTwoFoldCreator
with a given number of
splits.numSplits
- The number of splits to create. The number of folds created is
twice this number. It must be positive.public RandomByTwoFoldCreator(int numSplits, java.util.Random random)
RandomByTwoFoldCreator
with a given number of
splits.numSplits
- The number of splits to create. The number of folds created is
twice this number. It must be positive.random
- The random number generator to use.public java.util.List<PartitionedDataset<DataType>> createFolds(java.util.Collection<? extends DataType> data)
ValidationFoldCreator
createFolds
in interface ValidationFoldCreator<DataType,DataType>
data
- The data to create multiple folds from.public int getNumSplits()
public void setNumSplits(int numSplits)
numSplits
- The number of splits to perform. Must be positive.