Class CrossValidationBuilder<T extends DataObject>
java.lang.Object
de.uni_trier.wi2.procake.data.trainingObjectPool.CrossValidationBuilder<T>
Creates pools for cross validation based on
TrainingObjectPool
. If the elements cannot be
distributed equally among the test pools, the excess elements are distributed to these according
to the order.- Author:
- Alexander Schultheis
-
Constructor Summary
ConstructorDescriptionCrossValidationBuilder
(@NotNull WriteableObjectPool<T> pool, int k, double splitRatio, boolean shuffle) Constructor that creates k differentTrainingObjectPools
from aWriteableObjectPool
, each containing a test pool of size splitRatio and a training pool. -
Method Summary
Modifier and TypeMethodDescriptionMethod that returns the next of the created k TrainingObjectPools.Method that returns the list of TrainingObjectPools of size k.
-
Constructor Details
-
CrossValidationBuilder
public CrossValidationBuilder(@NotNull @NotNull WriteableObjectPool<T> pool, int k, double splitRatio, boolean shuffle) Constructor that creates k differentTrainingObjectPools
from aWriteableObjectPool
, each containing a test pool of size splitRatio and a training pool.- Parameters:
pool
- The WriteableObjectPool to be split.k
- Number of desired TrainingObjectPools.splitRatio
- Specifies the ratio according to which the test data is created.shuffle
- If true, then the elements of the pool are randomly shuffled before the cross validation pools are created.
-
-
Method Details
-
getTrainingObjectPools
Method that returns the list of TrainingObjectPools of size k.- Returns:
- The list of TrainingObjectPools.
-
getNextTrainingObjectPool
Method that returns the next of the created k TrainingObjectPools.- Returns:
- Next element from the list of TrainingObjectPools. Null, if no more pools are available.
-