Interface IStratiFileAssigner
-
- All Known Implementing Classes:
ClassStratiFileAssigner
public interface IStratiFileAssignerInterface to implement custom Stratum assignment behavior. A temporary file for each Stratum has to be created and the corresponding datapoints written into it. Each temporary file has to be a valid subset of the input file, i.e the ARFF header has to be written at the top of the file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassignDatapoint(java.lang.String datapoint)Select the suitable stratum for a datapoint and write it into the corresponding temporary file.java.util.Map<java.lang.String,java.lang.Integer>getAllCreatedStrati()Get the used strati temporary files and the amount of datapoints inside of it.voidsetArffHeader(java.lang.String arffHeader)Set the header of the original ARFF input file.voidsetTempFileHandler(ai.libs.jaicore.basic.TempFileHandler tempFileHandler)Set the temporary file handler, which will be used to manage the temporary files for the strati.
-
-
-
Method Detail
-
setTempFileHandler
void setTempFileHandler(ai.libs.jaicore.basic.TempFileHandler tempFileHandler)
Set the temporary file handler, which will be used to manage the temporary files for the strati.- Parameters:
tempFileHandler- Temporary File Handler to manage the files.
-
setArffHeader
void setArffHeader(java.lang.String arffHeader)
Set the header of the original ARFF input file. It has to be written on top of each temporary file. Besides of that it can be used to extract meta data about the dataset if needed.- Parameters:
arffHeader- ARFF header lines as a string.
-
assignDatapoint
void assignDatapoint(java.lang.String datapoint) throws ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmExceptionSelect the suitable stratum for a datapoint and write it into the corresponding temporary file.- Parameters:
datapoint- String representation of the datapoint taken from the input file.- Throws:
ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException- The datapoint representation was invalid or it could not be assigned to a stratum.
-
getAllCreatedStrati
java.util.Map<java.lang.String,java.lang.Integer> getAllCreatedStrati()
Get the used strati temporary files and the amount of datapoints inside of it.- Returns:
- Mapping from UUID of the temporary file of a strati to the number of datapoints written into it.
-
-