Class TrainingObjectPool<T extends DataObject>
java.lang.Object
de.uni_trier.wi2.procake.data.trainingObjectPool.TrainingObjectPool<T>
Stores training data (train, test, validate) in a single data structure rather than keeping track
of three individual pools. The pool can either be created directly from three different pools or
being generated by a builder. It is possible to only store train and test data.
- Author:
- Maximilian Hoffmann
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTrainingObjectPool
(@NotNull WriteableObjectPool<T> trainPool, WriteableObjectPool<T> testPool, WriteableObjectPool<T> validatePool) Use this constructor to create the training pool from three individual pools.TrainingObjectPool
(@NotNull WriteableObjectPool<T> tmpPool, TrainingObjectPoolSplit split, boolean shuffle) Use this constructor to create a training pool from a single pool that is split up into three separate pools.TrainingObjectPool
(@NotNull String pathTrainPool, String pathTestPool, String pathValidatePool, boolean instantLoad) Use this constructor to create the training pool from three individual pools, which paths are given. -
Method Summary
Modifier and TypeMethodDescriptionGetter method for the path to the xml file of the test pool.Getter method for the path to the xml file of the train pool.Getter method for the path to the xml file of the validate pool.Returns the unique name, each pool must have.Getter method that returns the test pool.Getter method that returns the train pool.Getter method that returns the validate pool.boolean
hasSameValueAsIn
(TrainingObjectPool<T> trainingObjectPool) This method makes a deep compare.void
setPathTestPool
(String pathTestPool) Setter method to adjust the path to the xml file of the test pool.void
setPathTrainPool
(String pathTrainPool) Setter method to adjust the path to the xml file of the train pool.void
setPathValidatePool
(String pathValidatePool) Setter method to adjust the path to the xml file of the validate pool.
-
Field Details
-
PATH_TRAIN_POOL
-
PATH_TEST_POOL
-
PATH_VALIDATE_POOL
-
-
Constructor Details
-
TrainingObjectPool
public TrainingObjectPool(@NotNull @NotNull WriteableObjectPool<T> trainPool, WriteableObjectPool<T> testPool, WriteableObjectPool<T> validatePool) Use this constructor to create the training pool from three individual pools. This way you can put together the three pools as you like. Best suited for existing implementations.- Parameters:
trainPool
- the training pool (should not be null)testPool
- the testing pool (can be null)validatePool
- the validation pool (can be null)
-
TrainingObjectPool
public TrainingObjectPool(@NotNull @NotNull String pathTrainPool, String pathTestPool, String pathValidatePool, boolean instantLoad) Use this constructor to create the training pool from three individual pools, which paths are given. This way you can put together the three pools as you like.- Parameters:
pathTrainPool
- the path to the training pool (should not be null)pathTestPool
- the path to the testing pool (can be null)pathValidatePool
- the path to the validation pool (can be null)instantLoad
- If true, the pools are read in directly. Otherwise, they are deserialized only when the corresponding getter methods are called. Thus, for example, the runtime can be optimized if the pools do not have to be read in at all.
-
TrainingObjectPool
public TrainingObjectPool(@NotNull @NotNull WriteableObjectPool<T> tmpPool, TrainingObjectPoolSplit split, boolean shuffle) Use this constructor to create a training pool from a single pool that is split up into three separate pools. It is possible with this method to only extract a training pool (would be the entire tmpPool), to extract training and testing pools, or all three pools. This can be specified by the split.- Parameters:
tmpPool
- the pool to split upsplit
- determines how to split tmpPoolshuffle
- If true, then the elements of the pool are randomly shuffled before being split among the different pools.
-
-
Method Details
-
getPoolName
Returns the unique name, each pool must have. -
getTrainPool
Getter method that returns the train pool. If the individual pools were not read in when the training object pool was created, the train pool is read in using this method.- Returns:
- The train pool.
-
getTestPool
Getter method that returns the test pool. If the individual pools were not read in when the training object pool was created, the test pool is read in using this method.- Returns:
- The test pool. If this was not specified, null is returned.
-
getValidatePool
Getter method that returns the validate pool. If the individual pools were not read in when the training object pool was created, the validate pool is read in using this method.- Returns:
- The validate pool. If this was not specified, null is returned.
-
getPathTrainPool
Getter method for the path to the xml file of the train pool.- Returns:
- Path of the train pool file.
-
setPathTrainPool
Setter method to adjust the path to the xml file of the train pool.- Parameters:
pathTrainPool
- The (new) path to the train pool file.
-
getPathTestPool
Getter method for the path to the xml file of the test pool.- Returns:
- Path of the test pool file.
-
setPathTestPool
Setter method to adjust the path to the xml file of the test pool.- Parameters:
pathTestPool
- The (new) path to the test pool file.
-
getPathValidatePool
Getter method for the path to the xml file of the validate pool.- Returns:
- Path of the validate pool file.
-
setPathValidatePool
Setter method to adjust the path to the xml file of the validate pool.- Parameters:
pathValidatePool
- The (new) path to the validate pool file.
-
hasSameValueAsIn
This method makes a deep compare. The elements in both pools are compared.- Parameters:
trainingObjectPool
- The object pool to compare.- Returns:
true
if the givenobject pool
has the same objects as this one.
-