INSTANCE
- Type of instancespublic class KFold<INSTANCE> extends Object implements CrossValidator<ListDataset<INSTANCE>>
ListDataset
s. The data is broken
into K approximately equally sized non-overlapping randomised subsets.
On each iteration, one subset is picked as the validation data and the
remaining subsets are combined to make the training data. The number of
iterations is equal to the number of subsets.
If the number of subsets is equal to the number of instances, then
the K-Fold Cross Validation scheme becomes equivalent to the
LOOCV scheme. The implementation of LOOCV in the LeaveOneOut
class is considerably more memory efficient than using this class
however.
Constructor and Description |
---|
KFold(int k)
Construct with the given number of folds.
|
Modifier and Type | Method and Description |
---|---|
CrossValidationIterable<ListDataset<INSTANCE>> |
createIterable(ListDataset<INSTANCE> data)
Create the iterable from the dataset.
|
String |
toString() |
public KFold(int k)
k
- the number of folds.public CrossValidationIterable<ListDataset<INSTANCE>> createIterable(ListDataset<INSTANCE> data)
CrossValidator
createIterable
in interface CrossValidator<ListDataset<INSTANCE>>
data
- the dataset