Class CrossValidationBuilder<T extends DataObject>
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.trainingObjectPool.CrossValidationBuilder<T>
-
public class CrossValidationBuilder<T extends DataObject> extends Object
Creates pools for cross validation based onTrainingObjectPool. 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
Constructors Constructor Description CrossValidationBuilder(@NotNull WriteableObjectPool<T> pool, int k, double splitRatio, boolean shuffle)Constructor that creates k differentTrainingObjectPoolsfrom aWriteableObjectPool, each containing a test pool of size splitRatio and a training pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrainingObjectPool<T>getNextTrainingObjectPool()Method that returns the next of the created k TrainingObjectPools.List<TrainingObjectPool<T>>getTrainingObjectPools()Method that returns the list of TrainingObjectPools of size k.
-
-
-
Constructor Detail
-
CrossValidationBuilder
public CrossValidationBuilder(@NotNull @NotNull WriteableObjectPool<T> pool, int k, double splitRatio, boolean shuffle)Constructor that creates k differentTrainingObjectPoolsfrom 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 Detail
-
getTrainingObjectPools
public List<TrainingObjectPool<T>> getTrainingObjectPools()
Method that returns the list of TrainingObjectPools of size k.- Returns:
- The list of TrainingObjectPools.
-
getNextTrainingObjectPool
public TrainingObjectPool<T> 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.
-
-