Class ClassStratiFileAssigner

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assignDatapoint​(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.
      void setArffHeader​(java.lang.String arffHeader)
      Set the header of the original ARFF input file.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassStratiFileAssigner

        public ClassStratiFileAssigner​(int targetAttribute)
        Constructor with a given target attribute.
        Parameters:
        targetAttribute - Index of the target attribute.
      • ClassStratiFileAssigner

        public ClassStratiFileAssigner()
        Constructor without a given target attribute. The last feature will be used.
    • Method Detail

      • setTempFileHandler

        public void setTempFileHandler​(ai.libs.jaicore.basic.TempFileHandler tempFileHandler)
        Description copied from interface: IStratiFileAssigner
        Set the temporary file handler, which will be used to manage the temporary files for the strati.
        Specified by:
        setTempFileHandler in interface IStratiFileAssigner
        Parameters:
        tempFileHandler - Temporary File Handler to manage the files.
      • setArffHeader

        public void setArffHeader​(java.lang.String arffHeader)
        Description copied from interface: IStratiFileAssigner
        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.
        Specified by:
        setArffHeader in interface IStratiFileAssigner
        Parameters:
        arffHeader - ARFF header lines as a string.
      • assignDatapoint

        public void assignDatapoint​(java.lang.String datapoint)
                             throws org.api4.java.algorithm.exceptions.AlgorithmException
        Description copied from interface: IStratiFileAssigner
        Select the suitable stratum for a datapoint and write it into the corresponding temporary file.
        Specified by:
        assignDatapoint in interface IStratiFileAssigner
        Parameters:
        datapoint - String representation of the datapoint taken from the input file.
        Throws:
        org.api4.java.algorithm.exceptions.AlgorithmException - The datapoint representation was invalid or it could not be assigned to a stratum.
      • getAllCreatedStrati

        public java.util.Map<java.lang.String,​java.lang.Integer> getAllCreatedStrati()
        Description copied from interface: IStratiFileAssigner
        Get the used strati temporary files and the amount of datapoints inside of it.
        Specified by:
        getAllCreatedStrati in interface IStratiFileAssigner
        Returns:
        Mapping from UUID of the temporary file of a strati to the number of datapoints written into it.